LJackson
03-05-2009, 02:16 PM
Hi,
I am having trouble with my sql code, i have correct query but i want to condense it if possible and get my php page to perform the query.
here are the querys
UPDATE ratings SET used_ips = 'NULL',total_value = '0',total_votes = '0' WHERE id = 'valuetemp';
UPDATE ratings SET used_ips = 'NULL',total_value = '0',total_votes = '0' WHERE id = 'easeofusetemp';
UPDATE ratings SET used_ips = 'NULL',total_value = '0',total_votes = '0' WHERE id = 'deliverytemp';
UPDATE ratings SET used_ips = 'NULL',total_value = '0',total_votes = '0' WHERE id = 'delchargetemp';but im not sure how to use this data,
usually i would update one record which i can handle by doing
$sql ="UPDATE ratings SET used_ips = 'NULL',total_value = '0',total_votes = '0' WHERE id = 'easeofusetemp'";
$query = mysql_query($sql);
but im not sure if i will have to run 4 individual queries as above or if it can be done in one query
if anyone can help
thanks
Luke
I am having trouble with my sql code, i have correct query but i want to condense it if possible and get my php page to perform the query.
here are the querys
UPDATE ratings SET used_ips = 'NULL',total_value = '0',total_votes = '0' WHERE id = 'valuetemp';
UPDATE ratings SET used_ips = 'NULL',total_value = '0',total_votes = '0' WHERE id = 'easeofusetemp';
UPDATE ratings SET used_ips = 'NULL',total_value = '0',total_votes = '0' WHERE id = 'deliverytemp';
UPDATE ratings SET used_ips = 'NULL',total_value = '0',total_votes = '0' WHERE id = 'delchargetemp';but im not sure how to use this data,
usually i would update one record which i can handle by doing
$sql ="UPDATE ratings SET used_ips = 'NULL',total_value = '0',total_votes = '0' WHERE id = 'easeofusetemp'";
$query = mysql_query($sql);
but im not sure if i will have to run 4 individual queries as above or if it can be done in one query
if anyone can help
thanks
Luke