Create table using MySQL

82 views

how to create a table using mySQL in PHP??  Answer goes here:

  1.  <?
  2. mysql_select_db(’foo’);
  3. $result = mysql_query(”CREATE TABLE users (
  4. id varchar(16) binary NOT NULL default ”,
  5. Password varchar(16) NOT NULL default ”,
  6. Name varchar(64) default NULL,
  7. email varchar(64) default NULL,
  8. ts timestamp(14) NOT NULL,
  9. PRIMARY KEY (id)
  10. ));
  11. if($result) {
  12. echo “Table created”;
  13. } else {
  14. }
  15. ?>



« Creating a MySQL database Insert Query in MySQL »
Posted on Monday, March 9th, 2009 at 2:49 pm under Basic of MySQL | RSS 2.0 Feed

Post Comment

You must be logged in to post a comment.



ComputerEducationWorld.com All Rights Reserved © RSS | CBSE | Education Boards Of India | What is My IP?