vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   SQL error help! (https://vborg.vbsupport.ru/showthread.php?t=77669)

LauraFL 03-07-2005 06:06 PM

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?

Marco van Herwaarden 03-07-2005 06:39 PM

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?

LauraFL 03-07-2005 06:41 PM

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

Marco van Herwaarden 03-07-2005 06:45 PM

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)

LauraFL 03-07-2005 06:54 PM

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;



Marco van Herwaarden 03-07-2005 06:59 PM

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

(probably in the function cache_permissions)

LauraFL 03-07-2005 07:03 PM

I did when I was installing the arcade. Not the cache_permissions but some others.

Marco van Herwaarden 03-07-2005 07:06 PM

I would double check those edits then. 99% chance that is where the error is.

YLP1 03-19-2005 12:54 PM

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


All times are GMT. The time now is 02:06 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01723 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete