You are here: Re: Create table LIKE won't work « PHP Programming Language « IT news, forums, messages
Re: Create table LIKE won't work

Posted by Rami Elomaa on 07/14/07 14:51

Robbo kirjoitti:
> Hi,
>
> PHP - I'm trying to create a MySQL table like an existing MySql table.
>
> My PHP code is
>
> $query = "CREATE TABLE '".$new_db."'.'".$new_name."' LIKE '".
> $old_db."'.'".$old_name."'";
> echo mysql_error()."<br>";
>
> When I run in the browser I get -
>
> You have an error in your SQL syntax near
> ''forest_client_XXX000001'.'accounts' LIKE
> 'forest_client_fds000003'.'accounts'' at line 1
>
> The $new_db, $old_db and $old_name all do exist
>
> I have tried removing the quote marks and have tried to do it in
> MyPHPAdmin all to no avail
>
> Any ideas gratefully received
>

Where did you get the idea that this would actually work? I must admit
that I haven't checked the MySQL documentation for a while, but I don't
think this is the way to do it at all. LIKE is a reserved keyword
indeed, but for a completely different purpouse, it's a string
comparison operator.

--
Rami.Elomaa@gmail.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze

 

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

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