|
Posted by John Moore on 10/31/05 04:08
Hi,
I must be missing something obvious.
I cannot get this function to run the update query on Line 6, although
the call to run the query evaluates true, and both update_cat_total
functions execute, while the function itself returns true.
A var_dump shows that all the variables are valid, and I can run the
exact same update query at the mysql command line without errors. I've
echoed mysql_error() before and after the call to mysql_query() and no
errors show up.
But the update itself never runs! Can anyone see why?
function new_category($category_id=null) {
global $category_id_new;
if (create_category($_SESSION['cat_name'])) {
// update this page with the new category_id
$query = "UPDATE
about
SET
category_id = $category_id_new
WHERE
about_id = $_SESSION[about_id]";
if ($result = mysql_query($query)) {
if (update_cat_total('add', $category_id_new) &&
update_cat_total('remove', $category_id)) {
return true;
}
else {
return false;
}
}
else {
return false;
}
}
else {
return false;
}
}
Thanks
J Moore
Navigation:
[Reply to this message]
|