PDA

View Full Version : whats wrong with this?


Slynderdale
04-25-2002, 12:17 PM
function getpictureurl($userid) {
global $DB_site,$session;

if ($pictureinfo=$DB_site->query_first("SELECT user.pictureid NOT ISNULL(picturedata) AS hascustom
FROM user
LEFT JOIN userpicture ON userpicture.userid=user.userid
WHERE user.userid='$userid'")) {
if ($pictureinfo['hascustom']) {
return "userpicture.php?userid=$userid&dateline=$pictureinfo[dateline]";
} else {
return '';
}
}
}

Slynderdale
04-25-2002, 12:19 PM
Database error in vBulletin 2.2.3:

Invalid SQL: SELECT user.pictureid NOT ISNULL(picturedata) AS hascustom
FROM user
LEFT JOIN userpicture ON userpicture.userid=user.userid
WHERE user.userid='1'
mysql error: You have an error in your SQL syntax near 'ISNULL(picturedata) AS hascustom
FROM ' at line 1

mysql error number: 1064

Neo
04-25-2002, 07:02 PM
Try using NULL instead of ISNULL

Admin
04-26-2002, 12:18 PM
A comma is missing before NOT ISNULL.