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 1You 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 1
strange enough this error came out of no where with no changes made to any files, i've searched Index.php and can't find a problem there, so i will paste the code here.. im not sure what the problem is here but let me know if you can help:
Code:
<?php require_once "../maincore.php"; require_once BASEDIR."subheader.php"; include LOCALE.LOCALESET."forum/main.php"; if (empty($lastvisited)) { $lastvisited = time(); } echo "<table cellpadding='0' cellspacing='0' width='100%' class='tbl-border'><tr><td> <table border='0' cellpadding='0' cellspacing='1' width='100%'><tr> <td style='padding: 8px 4px 8px 4px; text-align:center; font-size: 10px; font-weight:bold;' colspan='2' class='tbl2'>"; $msg_count = dbcount("(message_id)", "messages", "message_to='".$userdata['user_id']."' AND message_read='0'AND message_folder='0'"); if (iMEMBER) { echo "<table border='0' cellpadding='0' style='border-collapse: collapse' width='100%' id='table1'> <tr><td width='150'>"; if ($userdata['user_avatar'] != "") { echo "<center><img border='0' alt='".$locale['on106']."' title='".$locale['on106']."' src='".BASEDIR."images/avatars/".$userdata['user_avatar']."'></center>\n"; } else { echo "<br><center><img border='0' alt='".$locale['on107']."' title='".$locale['on107']."' src='".INFUSIONS."user_info_panel/images/noimage.gif'></center><br>\n"; } echo "</td><td width=500>"; $your_color = dbresult(dbquery("SELECT rank_color FROM ".$db_prefix."clanranks WHERE rank_id = ".$userdata['user_clanrank']),0); echo "Welcome <b><font color='$your_color'>".$userdata['user_name']."</font></b> - You have $msg_count message(s) in your inbox. [<a href='".BASEDIR."setuser.php?logout=yes'><b>".$locale['420']."</b></a>]<br>"; $yourposts = number_format($userdata['user_posts']); $facount = dbresult(dbquery("SELECT count(post_id) FROM ".$db_prefix."posts"),0); if ($yourposts == 0) { echo "You have made no posts. this is 0% of the total ".$facount." posts on this forum.<br>"; } else { $yourperc = number_format((($yourposts/$facount)*100),1); echo "Your posts: ".$yourposts.", this is ".$yourperc."% of the total ".$facount." posts on this forum.<br>";} $result = dbquery( "SELECT tp.*, tf.* FROM ".$db_prefix."posts tp INNER JOIN ".$db_prefix."forums tf USING(forum_id) WHERE ".groupaccess('forum_access')." AND tp.post_datestamp>'$lastvisited'" ); $howmanyposts = dbrows($result); echo "<br>There have been <b>$howmanyposts</b> post(s) since your last visit on ".($userdata['user_lastvisit'] != 0 ? showdate("longdate", $userdata['user_lastvisit']) : $locale['u049'])."."; include ('latestpost.php'); echo "<hr width=500 align=left><a href='".BASEDIR."profile.php?lookup=".$userdata['user_id']."'>".$locale['414']."</a> "; echo "<img border='0' src='".THEME."images/bullet.gif'> <a href='".BASEDIR."edit_profile.php'>".$locale['415']."</a> "; if (iMEMBER) { echo "<img border='0' src='".THEME."images/bullet.gif'> <a href='".BASEDIR."messages.php'>".$locale['417']." ($msg_count)</a> "; echo "<img border='0' src='".THEME."images/bullet.gif'> <a href='".BASEDIR."members.php'>".$locale['418']."</a> "; } else { echo " "; } echo "<img border='0' src='".THEME."images/bullet.gif'> <a href='".BASEDIR."faq.php?cat_id=4'>".$locale['419']."</a> "; if (iMEMBER) { echo "<br><a href='".BASEDIR."newest_threads.php'>Newest Threads</a> "; echo "<img border='0' src='".THEME."images/bullet.gif'> <a href='".BASEDIR."infusions/forum_threads_list_panel/my_threads.php'>My Recent Threads</a> "; echo "<img border='0' src='".THEME."images/bullet.gif'> <a href='".BASEDIR."infusions/forum_threads_list_panel/my_posts.php'>My Recent Posts</a> "; echo "<img border='0' src='".THEME."images/bullet.gif'> <a href='".BASEDIR."infusions/forum_threads_list_panel/new_posts.php'>New Posts</a> "; } echo "</td><td align='center' valign='top'><center><b>Top Posters</b></center><br><table border=0 width=150><tr><td>"; include ('topposters.php'); echo "</td></tr></table></td></tr></table>";
thats exactly my point , i dont know why its showing this error
But if you say that this happend without that you changed something then maybe your provider has changed something, ask him first (as for register_globals)
Global Moderator
Internet Junkie
Gender:
Posts: 1807
9006 credits Members referred : 6
« Reply #4 on: Oct 07, 2006, 01:26:43 PM »
yes, since the error states something is wrong near '' it looks like you have an empty variable. The appearance of the error without you changing anything could very well be caused by register_globals being turned off. My own host has changed this last week, causing some errors to appear on some of my sites.
If its a register_globals problem you could upload a php.ini with register_globals on as a quick fix, then try to fix your code to be able to work with register_globals off as the on setting can cause serious security issues...
« Last Edit: Oct 07, 2006, 01:28:53 PM by Mind_nl »
If its a register_globals problem you could upload a php.ini with register_globals on as a quick fix, then try to fix your code to be able to work with register_globals off as the on setting can cause serious security issues...