hi there:
the idea of the following code is : $q is a result set with products_id and quantity, and i want to update the table products with this values, simple enough? not!
the script run but doesnt changes anything i tryed everything ican think of. please let me know what am I doing wrong
While ($row=mysql_fetch_row($q))
{
$up_q=mysql_query("UPDATE products Set products.products_quantity = '$row[1]' AND products_last_modified = NOW() WHERE products_id = '$row[0]' ");
if (mysql_affected_rows()>0){
echo "Changed Product: $row[0] stock is now: $row[1] <br>";
}
the idea of the following code is : $q is a result set with products_id and quantity, and i want to update the table products with this values, simple enough? not!
the script run but doesnt changes anything i tryed everything ican think of. please let me know what am I doing wrong
While ($row=mysql_fetch_row($q))
{
$up_q=mysql_query("UPDATE products Set products.products_quantity = '$row[1]' AND products_last_modified = NOW() WHERE products_id = '$row[0]' ");
if (mysql_affected_rows()>0){
echo "Changed Product: $row[0] stock is now: $row[1] <br>";
}