Oo thanks for that. Simple.
However now that I have added a timestamp column in my table my form wont work.
<?php
if ($post == "yes") {
$sql = "INSERT INTO cmir_news (
header,
link,
content
$addl_insert_crit ) VALUES ( '$header',
'$link',
'$content'
$addl_insert_values )";
if ($sql_debug_mode==1) { echo "<BR>SQL: $sql<BR>"; }
$result = mysql_query($sql,db());
if ($result == 1) {
echo "Record Inserted";
} else {
echo "Error inserting record (9994SQL)";
}
} //END IF POST = YES FOR ADDING NEW RECORDS
if (!$post) {
/*-- SECTION: 9994FORM --*/
?>
<form method="post" action="<?php echo $thispage; ?>?proc=New&post=yes&<?php echo $pagevars; ?>">
<center>
<TABLE>
<TR>
<TD>
<B>HEADER:</B>
</TD>
<TD>
<INPUT TYPE='header' NAME='header' SIZE='20'> </TD>
</TR>
<TR>
<TD>
<B>LINK:</B>
</TD>
<TD>
<INPUT TYPE='link' NAME='link' SIZE='20'> </TD>
</TR>
<TR>
<TD>
<B>CONTENT:</B>
</TD>
<TD>
<TEXTAREA NAME='content' rows='4' cols='35'></textarea> </TD>
</TR>
<TR>
<TD>
</TD>
<TD>
<INPUT TYPE="SUBMIT" VALUE="Add Record" NAME="submit">
<INPUT TYPE="RESET" VALUE="Reset" NAME="reset">
</TD>
</TR>
</TABLE>
</CENTER>
<BR>
</FORM>
<?php
} //END if post=""
//***** END ADD NEW ENTRY FORM*****
function db()
{
$dbuser = "m";
$dbserver = "localhost";
$dbpass = "m";
$dbname = "m";
//CONNECTION STRING
$db_conn = mysql_connect($dbserver, $dbuser, $dbpass)
or die ("UNABLE TO CONNECT TO DATABASE");
mysql_select_db($dbname)
or die ("UNABLE TO SELECT DATABASE");
return $db_conn;
}//end function db
?>
D0 I have to add something that posts the date to the date(timestamp) column? I thought that by selecting timestap as a column in mysql table that this would stamp all entries automatically.
How does this work then?