I've been readint he tutorial y'all have on this site...it's great.

Anyway, to "learn" this stuff, I try tinkering with scripts, but it won't work for some reason. It displays the jokes, but for some reason, when I tell it to add a joke, it won't. Here's the code I've been trying to use. (Can someone also explain to me how 'if("ADD" == $submitjoke){' is supposed to work...I don't understand how that is triggered when the user clicks on the button and submits the form .... maybe I M just to used to JavaScript, but I want to UNDERSTAND the language, so please help. (since it displays the info fromt he database, I know that it is connecting.)

<title>Today's Date</title>

$dbcnx = @mysql_connect("localhost","root","");


<h1>Add a Joke:</h1><br>
<form method="post" action="<?php echo($PHP_SELF);?>">
<textarea name="JokeText">Type your joke here:</textarea><br>
<input type="submit" name="submitjoke" value="ADD">

if("ADD" == $submitjoke){
$sql="INSERT INTO Jokes SET".
"JokeText='JokeText', ".


<h1>Jokes thus far:</h1>
$jokes = mysql_query("SELECT JokeText FROM Jokes");

while ($row=mysql_fetch_array($jokes)){
echo("<P>" . $row["JokeText"]."</p>");