RE: [PHP-DB] Multiply Auto_Increments
| From: | Toby Parkins | Date: | Wed, 13 Nov 2002 23:53:16 +0000 |
| Subject: | RE: [PHP-DB] Multiply Auto_Increments | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-23315@lists.php.net to get a copy of this message | ||
Hi Richard,
Thank you for all your time. It is nearly midnight here!
All the code including // test sections is
<body background="#FFFFFF" bgcolor="#FFFFFF">
<p>
<?
include("../include/config.php");
///
// To be finished
// if (checkdate($month, $day, $year)) {print ("header etc.........
redirection if date is wrong
////
$exdate = "$year-$month-$day";
$date = date("Y-m-d");
$sql = "
INSERT INTO $table
(id,date,user,title,brief,body,expires,visible)
VALUES(NULL,\"$date\",\"$user\",\"$title\",\"$brief\",\"$body\",\"$exdate\",
\"1\")
";
////// test simple SQL
// $sql = "
// INSERT INTO $table
//
(NULL,\"$date\",\"$user\",\"$title\",\"$brief\",\"$body\",\"$exdate\",\"1\")
// ";
$connection = mysql_connect($dbhost, $dbusername, $dbpass) or die ("Could
not connect to database");
// if ($connection) { $msg = "Database Connection Established"; }
// echo ($msg);
$db = mysql_select_db($dbname) or die ("could not select db.");
$result = mysql_query($sql,$connection) or die ("Could not execute query");
// $result = mysql_query("insert into $table (user) values
('toby');",$connection) or die ("Could not execute query");
// if ($result) { $msg = "<br>News Article added"; }
// echo ($msg);
$close = mysql_close($connection) or die("Could not close database");
if ($close) {echo ("<br>Database closed");};
?>
Toby Parkins