Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php/mySQL query problem

Status
Not open for further replies.

solex

Programmer
Joined
Feb 28, 2003
Messages
91
Location
GB
does any one know why :

$query = "ALTER TABLE 'bace' ADD '$id' TEXT NOT NULL";

does not work, i have checked that $id has a value, and that the table bace is made,

thanx in advance

SOLEX
 
bace,

have MySQL tell you the error:
Code:
$result = mysql_query($SQL) OR die(mysql_error());

This will print out the error and help locate it.

Just from the first look:
You use single quotes around the table and field identifiers. You should use the backtick instead:
Not ' but `. The backtick is on US keyboards under the tilde ~ left of the numeric key 1.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top