Problem Loading Two db Tables with Script

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

The purpose of the script below is to load the same news item into two
different MySQL tables (thus displaying the same news item on two web
pages). The problem I am having is this: The script actually
works--but just once. The next time I run it (even days later), it
will not load the data. It just displays the error message from line
#37; in other words, there is no value in $result.

(BTW, I have stripped out all security temporarily. I understand that
in its present form this is an insecure script. It is not being left
on the server.)

Server PHP: 4.3.4
Server MySQL: 3.23.58

Can anyone figure out why this script would successfully load the two
tables, but only once? Thank you for your time and consideration.



   $strTitle = 'Post Weekly News';
    require ("header.php");
<div id="center">
   <FORM action="<?=$PHP_SELF?>" method="POST">
   <p>Headline: <br>
   <INPUT TYPE="text" NAME="headline" SIZE="50" /><br>
   <p>Story text: <br>
   <TEXTAREA NAME="story" ROWS="10" COLS="50" /></TEXTAREA><br>
   <p>Start Date: <br>
   <INPUT TYPE="text" NAME="initdate" SIZE="12" /><br>
   <p>End Date: <br>
   <INPUT TYPE="text" NAME="expdate" SIZE="12" /></p>        
   <INPUT TYPE=submit name="reg2" VALUE="Submit" />
   <INPUT TYPE=reset VALUE="Clear Fields" />
   // Connect to the database server
   $dbcnx = @mysql_connect("localhost", <user>, <password>);
   if (!$dbcnx) exit();
   // Select the database
   if (! @mysql_select_db("<db_name>")) exit();
   if (!isset($reg2)) {
       echo("No submission yet.");
       // load row into news table
       $sql = "insert into news set
       $result = (@mysql_query($sql));
       if (!$result) {
           echo("<p>ERROR: <b>News</b> table NOT loaded.</p>");
           echo("<p><b>News</b> table loaded.</p>");
       if ($result) {
           $sql2 = "insert into hc_news set
           $result2 = (@mysql_query($sql2));
           if (!$result2) {
                echo("<p>ERROR: <b>HC_News</b> table NOT
                echo("<p><b>HC_News</b> table loaded.</p>");
                echo("<p>Both tables loaded successfully.</p>");

Site Timeline