PHP date
Posted: Sun Apr 15, 2007 9:42 pm
Everah | Please use
Here is my insert3.php:
when I call the $time all I get is 0000-00-00
Sorry if this makes no sense at all Bu t I appreciate your time.
Thanks,
TK
Everah | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello everyone.
I am having problems with my date showing up. In mysql database I have a row set as $time and it is date NOT NULL.
Here is my form:
[syntax="html"]<br><b><a NAME="ADD">Add a message to the board:</b><br>
<form action="insert3.php" method="post">
Name:<br> <input type="text" name="first"><br>
Message:<br> <textarea name="message" rows="15" cols="45"></textarea><br><br>
<input type="Submit" value="Submit">
</form></a>Code: Select all
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function redireccionar() {
setTimeout("location.href='main.php?id=tw_redireccion'", 8000);
}
</SCRIPT>
</head>
<BODY onLoad="redireccionar()">
</body>
</html>
<?
$username="blahblah";
$password="blahblah";
$database="blahboobooblah";
$first=$_POST['first'];
$message=$_POST['message'];
$time=$_POST['time'];
mysql_connect("blahboobooblah",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO blog VALUES ('','$first','$message','$time')";
mysql_query($query);
mysql_close();
echo "Thank You, <b>$first</b> your message was added to the administrator board.";
echo "<br><br>";
echo "$time";
?>
If you dont redirect in 5 seconds please click <a href="#">here</a>Sorry if this makes no sense at all Bu t I appreciate your time.
Thanks,
TK
Everah | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]