My function returns true but my code does not execute
- From: John Moore <nobody@xxxxxxxxxx>
- Date: Mon, 31 Oct 2005 02:08:16 GMT
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
.
- Follow-Ups:
- Re: My function returns true but my code does not execute
- From: Ewoud Dronkert
- Re: My function returns true but my code does not execute
- Prev by Date: Re: What IDE are you using?
- Next by Date: Re: Getting the filenames from a folder
- Previous by thread: Re: phpBB sites hacked.
- Next by thread: Re: My function returns true but my code does not execute
- Index(es):
Relevant Pages
|