user605505
user605505

Reputation: 59

my mysql query doesn't update my table

$query=UPDATE americana SET 7='99' WHERE Bdate='2011-04-15';

mysql_query($query);

7 is a column name and Bdate too it doesn't update my table?

Upvotes: 0

Views: 199

Answers (2)

Bajrang
Bajrang

Reputation: 8629

$query="UPDATE americana SET `7`='99' WHERE Bdate='2011-04-15'";
mysql_query($query);

The query should be enclosed in quotes and also marked column name with backtick(`)sign if it has name with starting from numeric value, try it now and see if it works better now...

Upvotes: 0

KoolKabin
KoolKabin

Reputation: 17653

if so enclose it with backtick "`"

$query="UPDATE americana SET `7`='99' WHERE Bdate='2011-04-15'"; 

Upvotes: 10

Related Questions