RE: Multiply Auto_Increments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux