You are here: Re: Creating a view « PHP Programming Language « IT news, forums, messages
Re: Creating a view

Posted by IchBin on 09/03/06 07:17

Whit wrote:
> I am having a terrible time trying to create a view. Here is the sql
> string:
>
> $sql = "CREATE VIEW v AS SELECT * FROM t1;";
>
> Here is the error:
>
> 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 'VIEW v
> AS SELECT FROM t1' at line 1
>
> So simple, yet so vexing. Any thoughts? Thanks,
>
> -- whit nelson
>

Looks fine to me. So make sure the version of MySQL you have supports
view. It started to be supported in MySQL version 5.0. The ';' in the
SQL statement is fine. It is a cmd terminator in SQL.

IMHO - If you want to use a view I would use it on complicated SQL table
relationships. I see no reason to build a view based on just one SQL table.

--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)

 

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

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