-
Always use quotes!
Generally I have found that the stuff right before the printed error is USUALLY the real cause, so I look at this:
WHERE language_id = $this_language_id
and I see that if $this_language_id is null, which I bet it is, it will throw an error.
Always a good idea to do this:
language_id = '$this_language_id'
... for one thing, many a hack was done with a quoteless ID. Look up SQL-injection for the gory details.
Anyway, may I suggest putting this in your toolbox:
$sql="some query";
$db=mysql_query($sql);
$ref = mysql_fetch_row($db);
if (mysql_error()){
print mysql_error()."<br>$sql<br>";
exit();
}
Seeing the Actual SQL after an error can usually speed up debugging by thousands!
-
excellent excellent and excellent! Thaks so much! Often the way you look at something for so long it ends up being something so simple. Exactly what you said, put the $this_language_id in quotes and hey presto all working.
Thanks so much
Andy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules