I have a legacy system that has switched to running PHP 5.3. An issue that has appeared is with the code designed to edit dynamically produced values in a table. The editinvoice array has no value. Any ideas?
//Line Item x:<input type="text" name="editinvoice[lineitem_text_x]">
//Value x:<input type="text" name="editinvoice[lineitem_amount_x]">
//edit values in the invoice table
$sqldata = array();
foreach ($_POST['editinvoice'] AS $k => $v)
{
$sqldata[] = "$k = '$v'";
}
$sql = "UPDATE db.invoices SET ".implode(',', $sqldata)." WHERE (booking_id = '$booking_id') LIMIT 1";
mysql_query($sql);
I'm aware mysql is depreciated, however, no resources to rewrite the system and it's on an intranet so no SQL injection worries.
$sqldataand$sql. what values they has? Try to directly run your output ofecho $sqlin the mysql. What is it says?mysqlextension?magic_quotes_gpcis turned off, and (b) you have a huge SQL injection hole that should be your main concern.