|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Is my code way off base? I can't get a table
created using php. $sql = "CREATE TABLE '$table'( partno CHAR(10) NOT NULL, descript CHAR(60) NOT NULL, cost DOUBLE(10,5) NOT NULL, user CHAR(15) NOT NULL, modelno CHAR(20) NOT NULL, PRIMARY KEY(partno))"; $result = MYSQL_QUERY($sql) or die ("Invalid create"); |
|
#2
|
|||
|
|||
|
I don't think you need the apostrophe's (') around the table name. That could be what's messing it up.
|
|
#3
|
|||
|
|||
|
Also, instead of using "or die" which doesn't give you any info, on the next line do this:
if (!$result){ print mysql_error(); exit; } This exits gracefully while still giving you the info you need to determine what went wrong. HTH Rod |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Creating mysql table using php |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|