Re: What is wrong with this INSERT?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Rahul Sitaram Johari wrote:
Oh I¹m sorry! I was messing with the code when I copied it to the mailing
list. This is the actual code:

    $sql = mysql_query("INSERT INTO olivejuice (WHEN, WHAT, WHO) VALUES
('$WHEN','$WHAT','$WHO')");

And the entire code:

    <?php
    //Add Record Function
    if($_POST['Submit']) {
    $db = mysql_connect("localhost","usr","pwd");
    mysql_select_db("thedb",$db) or die("Critical Error :".mysql_error());
    $WHEN = date(mdyHi);
    $WHAT = $_POST['WHAT'];
    $WHO = $_POST['WHO'];
    echo "<SPAN CLASS='BlackText'>$WHEN, $WHAT, $WHO</SPAN><br>";
$sql = mysql_query("INSERT INTO tbl (WHEN, WHAT, WHO) VALUES
('$WHEN','$WHAT','$WHO')");
    $result = mysql_query($sql) or die("Fatal Error :".mysql_error());
    echo "<span class='SmallText'><EM><STRONG>~: message sent
:~</STRONG></EM></span><BR><BR>";
    }
    ?>



you still doing the same thing running mysql_query on mysql_query, see the other guy's post for the correct answer


------------------------------------------------------------------------
Angelo Zanetti
Systems developer
------------------------------------------------------------------------

*Telephone:* +27 (021) 469 1052
*Mobile:*       +27 (0) 72 441 3355
*Fax:*            +27 (0) 86 681 5885
*
Web:* http://www.zlogic.co.za
*E-Mail:* angelo@xxxxxxxxxxxx <mailto:angelo@xxxxxxxxxxxx>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux