Jump to content

php insert help


snake310

Recommended Posts

What is the problem in this source , is it even possible to do something like this :

$recordset="INSERT INTO `$table`";
        $recordset .=" WHERE ";
$recordset .=" `$table`.serial = '$serial'";
$recordset .=" (OutTime, buyer) ";
$recordset .=" VALUES('$OutTime','$Buyer') ";
mysql_query($recordset);

Link to comment
https://forums.phpfreaks.com/topic/33567-php-insert-help/
Share on other sites

Well, you can't put WHERE clause in an INSERT, but I don't know what you're trying to do...

[code]INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
    [INTO] tbl_name [(col_name,...)]
    VALUES ({expr | DEFAULT},...),(...),...
    [ ON DUPLICATE KEY UPDATE col_name=expr, ... ][/code]

Are you trying to find which table has that value? If so, you should search for it beforehand.
Link to comment
https://forums.phpfreaks.com/topic/33567-php-insert-help/#findComment-157276
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.