You are here: Re: php sql "DROP TABLE" command « PHP Programming Language « IT news, forums, messages
Re: php sql "DROP TABLE" command

Posted by Toby A Inkster on 11/15/07 12:47

Tim Roberts wrote:
> Sanders Kaufman wrote:
>
>> I was under the impression that square braces were the way to go:
>> $sSQL = "DROP TABLE IF EXISTS [products]";
>
> No, that's a Microsoft extension that only works in Access. It isn't SQL.

And Microsoft SQL Server since, IIRC, version 7... or whenever it was they
started to really diverge from the Sybase code. (Microsoft SQL Server was
originally a re-badged version of Sybase SQL Server.)

The SQL-compliant way of quoting table names is to use double-quotes. But
since the OP was using MySQL, which doesn't support the SQL-compliant
method (not by default anyway), that wouldn't work.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 8 days, 19:40.]

TrivialEncoder/0.2
http://tobyinkster.co.uk/blog/2007/08/19/trivial-encoder/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация