0
$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?

0

2 Answers 2

10

if so enclose it with backtick "`"

$query="UPDATE americana SET `7`='99' WHERE Bdate='2011-04-15'"; 
Sign up to request clarification or add additional context in comments.

1 Comment

its backtick "`" key before 1 in keyboard not single quote
0
$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...

3 Comments

the query is in quotes and i added the backtick it doesn't work
this is the error message that i'm getting: Database query faild: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''7'='99' WHERE 'Bdate'='2011-04-15'' at line 1
Actually u have not added a backtick but u have added a single quote which u can see in error massage here :- '7'='99'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.