Re: syntax help~~~
| From: | Arcadius A. | Date: | Mon, 06 Aug 2001 07:50:56 +0000 |
| Subject: | Re: syntax help~~~ | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61362@lists.php.net to get a copy of this message | ||
Hello !
We could keep things simpler ...
Why not give a try to this ?:
$watchlist_query = mysql_query( "Create Table $temp ( WId int Not
Nullauto_increment, QId int not null, Primary Key (WId) )" ) or die ("Error
! Cannot create table !" . mysql_error() );
Hope it would work :o)
(At least the "mysql_error()" would show you the error code )
Arcad
"Coconut Ming" <coconut@maxis.net.my> wrote in message
news:3B6D32E6.6B47C76E@maxis.net.my...
> Hi
> I am having the problem in the coding below
>
> <?
>
> mysql_connect('localhost','123','123') or die ("Unable to
> connect to SQL
> Server");
> mysql_select_db('Helpwatch') or die ("Unable to select database");
>
> $temp = $username."watch";
> $watchlist_query = mysql_query("Create Table "$temp"(WId int Not Null
> auto_increment, QId int not null, Primary Key (WId));");
> ?>
>
> So.. in the above coding. I need to create a table. The table name
> should be a user-define name + "watch"
> I acquire the $username correctly and the variable $temp is working fine
> when I try to echo the value of it.
> Just say. I enter my username as coconut so I wish the mysql query to
> create a table called coconutwatch
> but I can't do that.. Because of the syntax error, the coding I have
> underline is where the parser told me that is an error there.
> I have playing around with it for 2 hours and more... but I cant solve
> it.. Anyway help is greatly appreciated.
> Thanks in advance.
>
> Sincerely
> Kok Ming
>