RE: mysql help (sorry, a bit OT)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Gary [mailto:php-general@xxxxxxxxxxxxxxx]
> Sent: Tuesday, November 16, 2010 5:35 AM
> To: php-general@xxxxxxxxxxxxx
> Subject:  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
changes
> the db contents) and would like to know that the sql I am generating (in
php
> - 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.
> 

Gary,

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 ;)

Regards,
Tommy


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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux