Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update statement not working

Status
Not open for further replies.

chigley

Programmer
Sep 30, 2002
104
GB
I have a table called Product. I am executing an update statement which does not error and does not update the data either!

$query="UPDATE Product SET ProdName ='" . $this->prodName . "', ProductCategory_ProdCategory = '" . $this->ProductCategory->productCategory . "', ReleaseDate = '" . $this->releaseDate . "', ProdDescription = '". $this->prodDescription . "' WHERE Product_ProdId = " . $this->prodId;
$result=$db->executeQuery($query) or die(mysql_error());

The code produces the following update statement :

UPDATE Product SET ProdName ='Additional Garter1', ProductCategory_ProdCategory = 'GARTR', ReleaseDate = '2006-09-14 00:00:00', ProdDescription = 'Some Desc1' WHERE Product_ProdId = 19

Any ideas?
 
If an update statement does not produce an error, chance are it's well-formed.

If a well-formed update statement with a WHERE clause does not update any records, chances are it's because no records match the WHERE clause.




Want the best answers? Ask the best questions! TANSTAAFL!
 
What is output after executing
Code:
SELECT * FROM Product WHERE Product_ProdId=19
and what is the output after executing
Code:
DESC Product
using something like MySQL Query Browser?

Andrew
Hampshire, UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top