mysql join default value
Posted
by andy
on Stack Overflow
See other posts from Stack Overflow
or by andy
Published on 2010-05-06T23:23:20Z
Indexed on
2010/05/06
23:28 UTC
Read the original article
Hit count: 231
I've been trying to use the IsNull() function to ensure that there is a value for a field.
$result = mysql_query("
SELECT crawled.id,IsNull(sranking.score,0) as Score,crawled.url,crawled.title,crawled.blurb
FROM crawled
LEFT JOIN sranking ON crawled.id = sranking.sid
WHERE crawled.body LIKE '%".$term."%'
ORDER BY Score DESC LIMIT " . $start . "," . $c . " ") or die(mysql_error());
But I get the error message:Incorrect parameter count in the call to native function 'IsNull'
Anybody have any ideas? I'm pretty new to mySQL.
© Stack Overflow or respective owner