Re: If( Query)

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

 



Do a print on the query:

>> function editproduct($item_id, $item_name, $item_desc, $item_price,
>> $item_pix, $item_man_id, $item_cat_id) {
>>        $item_id = mysql_real_escape_string($item_id);
>>        $item_name = mysql_real_escape_string($item_name);
>>        $item_desc = mysql_real_escape_string($item_desc);
>>        $item_price = mysql_real_escape_string($item_price);
>>        $item_pix = !empty($item_pix) ? mysql_real_escape_string($item_pix)
>> : null;
>>        $item_man_id = mysql_real_escape_string($item_man_id);
>>        $item_cat_id = mysql_real_escape_string($item_cat_id);
>>        connect();
>>        $sql = "UPDATE items SET item_name='{item_name}',
>> item_desc='{item_desc}', item_price='{item_price}', " .
>> (!empty($item_pix) ? "item_pix='{item_pix}', " : "") .
>> "item_man_id='{item_man_id}', item_cat_id='{item_cat_id}' WHERE
>> item_id={$item_id}";

  var_dump($sql);

>>        mysql_query($sql) or die('Insert failed: ' . mysql_error());
>> }

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux