php-db | 2000121
Date: 12/06/00
- Next message: carlstephen33 <email protected>: "[PHP-DB] [#1]"
- Previous message: Fábio Ottolini: "Re: [PHP-DB] Fw: Creating tables on the fly"
- In reply to: Fábio Ottolini: "Re: [PHP-DB] Fw: Creating tables on the fly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Use mySQL's "describe table" ability. It'll give you a result array
which'll have the column name, and it's type. =) Armed with
that information, you can then do you conversion. I used that
functionality to write a "wrapper generator" which outputs
some PHP classes, 1 per table and generic INSERT/UPDATE/LOAD
statements. *grin*
'Luck!
-Szii
----- Original Message -----
From: Fábio Ottolini <fabio.ottolini <email protected>>
To: db php <php-db <email protected>>
Sent: Wednesday, December 06, 2000 5:18 PM
Subject: Re: [PHP-DB] Fw: Creating tables on the fly
> Thanks, Doug! You answers always help me a lot! In fact in this case it
> really doesn't matter the MySQL sintax. I was just a little bit confused
> about how to proceed when my SysAdmin acts like a mule! You gave the
lights
> and that's exactly what I needed.
>
> Kind regards,
>
> Fábio Ottolini
>
> ----- Original Message -----
> From: "Doug Semig" <dougslist <email protected>>
> To: <php-db <email protected>>
> Sent: Wednesday, December 06, 2000 1:30 AM
> Subject: Re: [PHP-DB] Fw: Creating tables on the fly
>
>
> > 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>
> >
> >
>
>
>
> --
> 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>
-- 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: carlstephen33 <email protected>: "[PHP-DB] [#1]"
- Previous message: Fábio Ottolini: "Re: [PHP-DB] Fw: Creating tables on the fly"
- In reply to: Fábio Ottolini: "Re: [PHP-DB] Fw: Creating tables on the fly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

