MySQL via PHP Cheat Sheet
Connect to MySQL and to the database // Connect to MySQL $connect = mysql_connect(“localhost”, “mysqluser”, “userpassword”) or die(mysql_error()); // Select the database mysql_select_db(“databasename”, $connect) or die(mysql_error()); PHP Manual Reference us2.php.net/manual/en/function.mysql-connect.php Close connection // Use the variable that was used to connect to MySQL mysql_close($connect) or die(mysql_error()); // PHP Manual Reference: us2.php.net/manual/en/function.mysql-close.php Create a database mysql_create_db(“dbname”) […]