Reply to Re: odbc: mysql vs. postgresql

Your name:

Reply:


Posted by Dikkie Dik on 10/01/06 21:13

> I have a problem writing PHP ODBC scripts that suit both MySQL and
> PostgreSQL. So far, the following syntaxes seem to apply to each
> database (this is an 'insert' example; the same differences apply to
> 'select commands):
>
> MySQL: INSERT INTO MyTable (col1, col2) VALUES ("value1","value2")
> PGSQL: INSERT INTO "MyTable" (col1, col2) VALUES ('value1','value2')

You can run the second line in MySQL also - when you are running the
server in ANSI mode.

> I'd like to have a single syntax for both databases. Is this possible?

I think the SQL standard version of the above statements is:

INSERT INTO MyTable(col1, col2) VALUES ('value1','value2')

(Actually, the SQL version is without the columns, but most SQL
databases support the column list)
It would surprise me if PostGress would not understand this statement.

Best regards

[Back to original 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

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