topical media & game development

talk show tell print

server-php-sql-example-create.php / php



  <h4>create -- php/mysql</h4>
  <br>
  
  <?php
  mysql_connect("localhost", "root", "hush") or die(mysql_error());
  mysql_select_db("local") or die(mysql_error());
  
  // Create a MySQL table in the selected database
  mysql_query("CREATE TABLE example(
  id INT NOT NULL AUTO_INCREMENT, 
  PRIMARY KEY(id),
  name VARCHAR(30), 
  age INT)")
  or die(mysql_error());  
  
  echo "Table Created!";
  ?>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.