0

I'm learning php/mysql, I have made a php page and I have a form on a host that has a sqlbuddy database, when I ws a adding a column in the table but the I got this:

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 ''fan_comments' ADD 'dates' TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP' at line 1

This is what is my statement: ALTER TABLE 'fan_comments' ADD 'dates' TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP

But running the same command on my machine which uses phpMyAdmin the command works perfectly so I'm confused what the problem is..what can I do to correct that error?

Sello
  • 297
  • 1
  • 8
  • I don't think that this has to do with either phpMyAdmin or sqlbuddy. Probably the MySQL server version on both machines is different. Try to change the single quotes (`'`) to reversed ones (`\``). – user254875486 May 07 '13 at 10:02
  • Ohh didn't know those single reverse quotes had any significance or made any difference I just tried them and it works correctly and also works without any quotes around table name and column...thnx lex :) – Sello May 07 '13 at 10:27
  • No problem. I recommend using the reversed quotes, because you will need them if one of your column names happens to be an SQL keyword. So that's something to keep in mind. – user254875486 May 07 '13 at 11:21

0 Answers0