Reply to Re: Creating tables on-the-run

Your name:

Reply:


Posted by max on 08/13/05 16:25

On Sat, 13 Aug 2005 11:19:40 +0200, Stefan Rybacki <stefan.rybacki@gmx.net>
wrote:

>max wrote:
> > ,,,
>>
>> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
>> resource in
>> blah-blah/create_dbase.php on line 24
>>
>
>
>How about using mysql_error()?
>
>Regards
>Stefan
The following (if I have it right)

<?
$TableName=rand(12345, 99999);
connect string

print("$TableName");

$Query = "CREATE TABLE $TableName
(
'id' 'SMALLINT' 'NOT NULL',
'firstname' 'VARCHAR(255)' 'NOT NULL'
)";
$Result=mysql_db_Query ($DBName, $Query, $Link);
if (!($Result=mysql_db_query ($DBName, $Query, $Link)))
{
print("<br>errno: " .mysql_errno() );
print("<br>error: " . mysql_error() );
?>

brings

errno: 1064
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
'71010 ( 'id' 'SMALLINT' 'NOT NULL', 'firstname' 'VARCHAR(255)'
creation


in its wake, and I'm not much clearer. Can you help further?

[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

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