Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 03-07-2005, 06:06 PM
LauraFL LauraFL is offline
 
Join Date: Jan 2005
Location: Florida
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default SQL error help!

I am getting the following error when people try to open certain threads and any sticky post...

Quote:
Invalid SQL:
SELECT MAX(dateline) AS lastpost, COUNT(*) AS total
FROM vb_usernote AS usernote
WHERE userid =

mysql error: 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 3

mysql error number: 1064
I am not sure where the error is occuring or how to fix it. Can someone help me?
Reply With Quote
  #2  
Old 03-07-2005, 06:39 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you install any hacks recently?

The reason for the error is clear, there is no userid in teh WHERE clause. On what script you get this error?
Reply With Quote
  #3  
Old 03-07-2005, 06:41 PM
LauraFL LauraFL is offline
 
Join Date: Jan 2005
Location: Florida
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I get it at alot of places...

Date: Monday 07th of March 2005 03:30:11 PM
Script: http://www.sunshinestatemoms.com/for...read.php?t=393
Referer: http://www.sunshinestatemoms.com/for...searchid=13400

Date: Monday 07th of March 2005 03:29:41 PM
Script: http://www.sunshinestatemoms.com/for...read.php?t=514


Those are the 2 most recent
Reply With Quote
  #4  
Old 03-07-2005, 06:45 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please open your member.php file and find:
PHP Code:
// display user info 
Copy & paste the 10-15 lines after that here (use [ php] tags)
Reply With Quote
  #5  
Old 03-07-2005, 06:54 PM
LauraFL LauraFL is offline
 
Join Date: Jan 2005
Location: Florida
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$userperms cache_permissions($userinfofalse);

if (((
$userid == $bbuserinfo['userid'] AND $permissions['genericpermissions'] & CANVIEWOWNUSERNOTES) OR ($userid != $bbuserinfo['userid'] AND $permissions['genericpermissions'] & CANVIEWOTHERSUSERNOTES)) AND $userperms['genericpermissions'] & CANBEUSERNOTED)
{
    
$show['usernotes'] = true;
    
$usernote $DB_site->query_first("
        SELECT MAX(dateline) AS lastpost, COUNT(*) AS total
        FROM " 
TABLE_PREFIX "usernote AS usernote
        WHERE userid = 
$userinfo[userid]
    "
);
    
$show['usernotetotal'] = iif($usernote['total'], truefalse);
    
$usernote['lastpostdate'] = vbdate($vboptions['dateformat'], $usernote['lastpost'], true);
    
$usernote['lastposttime'] = vbdate($vboptions['timeformat'], $usernote['lastpost'], true);
}
else
{
    
$show['usernotes'] = false;

Reply With Quote
  #6  
Old 03-07-2005, 06:59 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm did you recently make any change to your includes/functions.php?

(probably in the function cache_permissions)
Reply With Quote
  #7  
Old 03-07-2005, 07:03 PM
LauraFL LauraFL is offline
 
Join Date: Jan 2005
Location: Florida
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did when I was installing the arcade. Not the cache_permissions but some others.
Reply With Quote
  #8  
Old 03-07-2005, 07:06 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would double check those edits then. 99% chance that is where the error is.
Reply With Quote
  #9  
Old 03-19-2005, 12:54 PM
YLP1 YLP1 is offline
 
Join Date: Aug 2004
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm having the same problem....were you able to determine what was causing it?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:12 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02219 seconds
  • Memory Usage 2,245KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete