811Chapter 43Weblogs$result = mysql_query($query); // Since we re not (Web site templates)
811Chapter 43Weblogs$result = mysql_query($query); // Since we re not using the standard MySQL// date format, store date as an integer$query2 = CREATE TABLE mylog (ID SMALLINT NOT NULLAUTO_INCREMENT PRIMARY KEY, date INT(8), blogtext TEXT) ; $result2 = mysql_query($query2); mysql_close(); if ($result > 0 && $result2 > 0) { echo ( Successfully created tables
n ); } else { echo ( Unable to create tables. ); } } else { echo ( Unable to create database ); } ?> After creating the database as the MySQL root user, you can grant a more restrictive permis- sions package to some other MySQL user and then run the following scripts as that user. Listing 43-13: Database Weblog login screen (db_login.php)
Use this login to add a new entry.
Use this login to edit a previous entry.