> -----Original Message-----
> From: Gary [mailto:php-gene...@garydjones.name]
> Sent: Tuesday, November 16, 2010 5:35 AM
> To: php-general@lists.php.net
> Subject: [PHP] mysql help (sorry, a bit OT)
> Is there a way to check the syntax of a query, short of running it? I've
got an
> insert to do (but of course it's a valid question for any query that
> the db contents) and would like to know that the sql I am generating (in
> - see! not so off-topic!) is correct.
> What I don't want to do is run it for testing (live system *sigh*) and
find out
> it is correct (it will change the db), but... I have to test it to check
that the
> syntax (at least) *is* correct.


If you use a current version of the MySQL workbench, the tool can send
complete SELECT, UPDATE, INSERT, DELETE statement, with all the fields, to
the query window for the selected table.  That way you'll know that you have
the proper field (name and quoted with `).  Add that to what Ash suggested
of having a local copy of the database, you'll have little or no chance of
breakage in the app because of a silly SQL syntax error ;)


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to