PHP

MySQL

<?php
//Connect to the database
   mysql_connect("localhost", "phpuser", "alm65z");
   mysql_select_db("phpdb");

//Send a query and get resutls
   $result = mysql_query("SELECT * FROM usertable");
   $numrows = mysql_num_rows($result);
   print "There are $numrows people in usertable\n";

//Use a variable in the query, just place it in.
   $result = mysql_query(
      "SELECT ID FROM webpages WHERE Title = '$SearchCriteria';");

//Free memory
   mysql_free_result($result);

//Close connection
   mysql_close();

?>

José M. Vidal .

32 of 33