MySQL Forums
Forum List  »  PHP

Problem with UPDATE to database table record
Posted by: Stephen Olds
Date: June 25, 2014 02:39AM

I need to update a database (scw_db) with a table (tblsplintersbowlinventory) from a list that contains id's, when I read an ID I want to set the txtVenue field of the matching record to "Shoreline 2014".

The code:

<?php
$con = mysql_connect("localhost","root","Skye_1999");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("scw-db", $con);
$filename = "InventoryList.txt";
$arr = file($filename);
foreach($arr as $r_bowlcode){
print $r_bowlcode . "<br />";
$result = mysql_query("UPDATE 'tblsplintersbowlinventory' SET 'txtVenue'='Shoreline 2014' WHERE 'txtProductBowlCode'='$r_bowlcode'");
echo "Record Updated";
}
mysql_close();
?>

This runs through the list, prints that it updated the record - but when I check the record in myPHPadmin it has not changed.

I'm really need a solution to this ASAP.

Options: ReplyQuote


Subject
Written By
Posted
Problem with UPDATE to database table record
June 25, 2014 02:39AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.