SQL Error : 1064

Résolu/Fermé
gostalker - 5 oct. 2007 à 09:25
 hotrod - 5 oct. 2007 à 21:02
Bonjour,
j ai un gros probleme avec mon forum les gens n arrive pas a s inscrire pouvez vous m aider merci d avance

voici l erreur
Could not find max privmsgs (inbox)

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 6

SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time FROM phpbb_privmsgs WHERE ( privmsgs_type = 1 OR privmsgs_type = 0 OR privmsgs_type = 5 ) AND privmsgs_to_userid = ;

Line : 93
File : functions_insert_pm.php



et voici le fichier a la ligne 93
$sqlf = 'SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time
FROM ' . PRIVMSGS_TABLE . '
WHERE ( privmsgs_type = ' . PRIVMSGS_NEW_MAIL . '
OR privmsgs_type = ' . PRIVMSGS_READ_MAIL . '
OR privmsgs_type = ' . PRIVMSGS_UNREAD_MAIL . ' )
AND privmsgs_to_userid = ' . $to_userdata['user_id'].';';
if ( !($result = $db->sql_query($sqlf)) )
{
message_die(GENERAL_ERROR, 'Could not find max privmsgs (inbox)', '', __LINE__, __FILE__, $sqlf);
}

$sql_priority = ( SQL_LAYER == 'mysql' ) ? 'LOW_PRIORITY' : '';
A voir également:

1 réponse

le contenu de $to_userdata['user_id'] n'est pas entre quote
11