Mysql/PHP

  • Tazel
  • Student
  • Student
  • Tazel
  • Posts: 97

Post 3+ Months Ago

What would be the best way to create a table for mysql? Would you use

Code: [ Select ]
if (IsSet(table1)) {
create table1 (Id blah, blah, blah);
}
  1. if (IsSet(table1)) {
  2. create table1 (Id blah, blah, blah);
  3. }


or would you just run a script like that once and then just delete it?
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

Just running a script once is how most all php/database driven scripts work. They normally have it in a file like mysql_install.php or something, which includes a simply mysql_query() that installs everything.
  • Tazel
  • Student
  • Student
  • Tazel
  • Posts: 97

Post 3+ Months Ago

So they have a file called that and run it. Then delete all that's in there. And if you need to create say new tables, then you add the wanted tables and delete them, etc.? Would that be a good choice of actioin to use?
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

I would use phpMyAdmin if you are going to be deleting/adding tables just for personal use. Once you feel you have something that can be distributed as a good script I would move to the one file with the sql_query in iit, then tell people to delete the file once installation is complete.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 56 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.