Re: CREATE TABLE $phpVariable_for_tableName <--- help please!
| From: | Jason Wong | Date: | Wed, 10 Mar 2004 07:37:00 +0000 |
| Subject: | Re: CREATE TABLE $phpVariable_for_tableName <--- help please! | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-33382@lists.php.net to get a copy of this message | ||
On Wednesday 10 March 2004 15:11, AJ Seelund wrote:
> 11 //create a table
> 12 $sql = 'CREATE TABLE $newTable (
daUser VARCHAR( 255 )
> NOT NULL ,'
> 13 . ' entryNumb INT NOT NULL ,'
> 14 . ' priv VARCHAR( 1 ) NOT NULL ,'
> 15 . ' comm BLOB NOT NULL ,'
> 16 . ' PRIMARY KEY ( entryNumb ) )';
> 17
> 18
> 19 $resulter = mysql_query($sql) or die("There has been an error
> creating table: $newTable");
> on line 12 is where ive narrowed the error to. i know that the table
> name is what is supposed to be there but im trying to create this based
> on a post entry number and then adding "_comms" to the name..
Right so echo($sql) to find your error.
> so the comments table for post number 1 would be named: 1_comms
> im also having an issue with line 3, creating that name
Use the concatenation operator, which is a period (.), a + is the mathematical
addition operator.
Also, always use mysql_error().
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
------------------------------------------
/*
Every journalist has a novel in him, which is an excellent place for it.
*/