You have a couple of options:
1. You can execute the query right after it is built and store the results in an array.
for($ct=0; $ct <=9; $ct++) {
$sql = "UPDATE image SET
image_name = $image.$ct,
image_over = $over.$ct
WHERE project_id = $project_id";
//Excute the query and store it's result in an array.
$sql_result[$ct] = mysql_query($sql, $mysql_link);
}
- Or you can build the queries in an array and then cyle through that array and execute them as you cyle.
for($ct=0; $ct <=9; $ct++) {
$sql[$ct] = "UPDATE image SET
image_name = $image.$ct,
image_over = $over.$ct
WHERE project_id = $project_id";
}
for($ct=0; $ct <=9; $ct++) {
$sql_result[$ct] = mysql_query($sql[$ct], $mysql_link);
}
I think the first way is better.
Hope that helps,
Daniel Ice
http://www.coderguy.com