hi
i removed the single quotes in the curdate() the problen still
the result for run the code is
Unknown column 'jukedate' in 'field list'
this all the joke in the database
joke1
joke2
add joke
this is the code
<html dir=rtl>
<?php
if (!isset($_POST['subnitjoke'])): ?>
<FORM ACTION-"<?php echo($_SERVER['PHP_SELF'] );?>" METHOD=POST>
<p>write your joke here to added it<BR>
<TEXTAREA NAME="joketext" rows="9" cols="42"> </TEXTAREA>
<BR><INPUT TYPE=SUBMIT NAME="subnitjoke" value="add">
</form>
<?php
else :
$dbcnx = @mysql_connect("localhost","dbuname","pass");
If (!$dbcnx) {
echo ("<p>can't connect to database99</p>");
exit();
}
If(!mysql_select_db("mydb"))
{
echo ("<p>can't connect to database</p>");
exit();
}
if ("add" == $_POST['subnitjoke']){
$sql = "insert into jokes set joketext='" . $_POST['joketext'] . "',jukedate=curdate()";
if(mysql_query($sql)) {
echo ("<p>the joke added</p>");
}else {
echo(mysql_error());
}
}
echo("<p> this all the joke in the database</p>");
$result=mysql_query("select * from jokes");
if (!$result) {
echo(mysql_error());
exit();
}
while($row = mysql_fetch_array($result)){
echo("<p>" . $row["joketext"] ."</p>");
}
echo("<p><A HREF='" . $_SERVER['PHP_SELF'] . "'> add joke</A></p>");
endif
?>