php-db | 2000121
Date: 12/05/00
- Next message: Leonard Tambunan: "Re: [PHP-DB] SQL wildcards???"
- Previous message: Chris Aitken: "Re: [PHP-DB] SQL wildcards???"
- In reply to: Fábio Ottolini: "[PHP-DB] Fw: Creating tables on the fly"
- Next in thread: David Tod Sigafoos: "Re[2]: [PHP-DB] Fw: Creating tables on the fly"
- Reply: David Tod Sigafoos: "Re[2]: [PHP-DB] Fw: Creating tables on the fly"
- Reply: Fábio Ottolini: "Re: [PHP-DB] Fw: Creating tables on the fly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
That's a tough one, Fábio. Maybe there's a MySQL specific mailing list?
As it stands, having not worked much with MySQL, I can only think of three
ways. None of them are optimal like "CREATE TABLE ... FROM SELECT ..."
would be.
1. Know the schema beforehand and hard-code it in your app.
2. Discover the schema by selecting out a row and iterating through the
fields with mysql_fetch_field() function and build the CREATE TABLE statement.
3. There's a web application written in PHP that is for administration of
MySQL installations. PHPMySQLAdmin or something like that (check
www.freshmeat.net). There may be some clues in there! That is, if it
works with pre-3.23 versions of MySQL, they had to figure out how to find
out the structure of a MySQL table for that app.
Oh, I suppose there's one more thing I can think of, but unfortunately it
only has a small chance of working right away...beg your sysadmin to
upgrade <grin>!
Good luck,
Doug
At 05:29 PM 12/5/00 -0200, Fábio Ottolini wrote:
>Hello!!!
>
>Please don't forget me... Could you please give me some insight about my
>approach to this problem?
>
>Kind regards,
>
>Fábio Ottolini
>
>----- Original Message -----
>From: "Fábio Ottolini" <fabio.ottolini <email protected>>
>To: "db php" <php-db <email protected>>
>Sent: Monday, December 04, 2000 4:58 PM
>Subject: Creating tables on the fly
>
>
>> Dear All,
>>
>> At home I have MySQL 3.23.27 but at the server I will host my application
>> the have version MySQL 3.22.19. This means that I cannot use a query like
>> "CREATE TABLE $tblname SELECT * FROM $tblname_ant;", because as far as I
>> know this was implemented just after version 3.23.* and MySQL running on
>the
>> host server is returning and error message anyway. Which is the best way
>to
>> create a new table on the fly using another one as a model with this
>> restriction?
>>
>> Best regards,
>>
>> Fábio Ottolini
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Leonard Tambunan: "Re: [PHP-DB] SQL wildcards???"
- Previous message: Chris Aitken: "Re: [PHP-DB] SQL wildcards???"
- In reply to: Fábio Ottolini: "[PHP-DB] Fw: Creating tables on the fly"
- Next in thread: David Tod Sigafoos: "Re[2]: [PHP-DB] Fw: Creating tables on the fly"
- Reply: David Tod Sigafoos: "Re[2]: [PHP-DB] Fw: Creating tables on the fly"
- Reply: Fábio Ottolini: "Re: [PHP-DB] Fw: Creating tables on the fly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

