vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   um BIG ISSUE (https://vborg.vbsupport.ru/showthread.php?t=43111)

DarkDraco07 09-03-2002 12:39 AM

um BIG ISSUE
 
i edited this post so erwins post doesnt make sence...


for some reason wehn someone is not logged in the forums, they cant log in and they get this error :

Quote:

Invalid SQL: SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=
mysql error: You have an error in your SQL syntax near '' at line 1

mysql error number: 1064

Date: Monday 02nd of September 2002 08:05:34 PM
Script: (Link: http://www.darknemesis.com/forums/forums/index.php?)http://www.darknemesis.com/forums/forums/index.php?
Referer:

Erwin 09-03-2002 12:43 AM

Reinstall the "Element" hack or whatever it is that uses the column element in your database.

DarkDraco07 09-03-2002 01:28 AM

ignore the post above by erwin,

also when u click on the members button or look for users in admin page, it only shows 2 people

Erwin 09-03-2002 01:38 AM

Mmm... something is wrong with the query that checks for total number PMs in your index.php. Go and compare the code between your index.php and an original unhacked index.php.

DarkDraco07 09-03-2002 01:46 AM

uh...if i do compare... i wont know what to look for

Erwin 09-03-2002 01:59 AM

The line is in your error email -

SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=

Just look for that line, and then compare that whole piece of code with the original. Chances are there is something missing or added that is causing a query error.

DarkDraco07 09-03-2002 02:37 AM

ok, looked at clean and hacked. there were 3 lines with that in it. i compared and they were all the same

g-force2k2 09-03-2002 05:18 PM

it seems that the userid variable that you're using isn't correct... can you show us the line of coding thats on the line erroring out? regards...

g-force2k2

DarkDraco07 09-03-2002 05:50 PM

what line is that? in index.php?

this is the line erwin was talking about

PHP Code:

  $allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
  
$newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
  
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers"); 


DarkDraco07 09-03-2002 11:09 PM

did i give the right info?

Erwin 09-03-2002 11:36 PM

Safest thing is to compare the original unhacked index.php and the hacked one using Beyond Compare or Araxis Merge - one of the variables in those 3 lines of code you posted is not being used properly.

DarkDraco07 09-04-2002 12:04 AM

uh....

index.php on old forum
PHP Code:

  $allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
  
$newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
  
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers"); 

new forum
PHP Code:

  $allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
  
$newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
  
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers"); 

unhacked
PHP Code:

  $allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
  
$newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
  
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers"); 


Erwin 09-04-2002 12:06 AM

No, the problem is obviously not in the PM queries, but in another part of your index. I am saying to compare the WHOLE index.php because one of the user variables are not being checked properly.

DarkDraco07 09-04-2002 12:15 AM

hmmm, is there a way i can contact u on some instant messenger? this is all confusing

Boofo 09-04-2002 12:32 AM

Try replacing what you have there with this:

PHP Code:

$allpm=$DB_site->query_first("SELECT COUNT(*) AS messages,
                                SUM(IF(dateline>
$bbuserinfo[lastvisit] AND folderid=0,1,0)) AS newpm,
                                SUM(IF(messageread=0 AND folderid=0,1,0)) AS unreadpm
                                FROM privatemessage WHERE userid=
$bbuserinfo[userid] $ignoreusers");

  
$newpm['messages']=$allpm['newpm'];
  
$unreadpm['messages']=$allpm['unreadpm']; 

This code will also cut 2 queries from your forumhome.

Erwin 09-04-2002 12:33 AM

I'm at work. :) So no. Compare the index.php with an unhacked one, and you will find the missing or erroneous code.

DarkDraco07 09-04-2002 01:04 AM

damn, i dont know where to start. index.php is a kinda big file to look word for word, plus with the hacksinstalled it will be harder

Boofo 09-04-2002 01:06 AM

DarkDraco07, replace the code I gave you and see if that does anything.

DarkDraco07 09-04-2002 01:16 AM

1sec

DarkDraco07 09-04-2002 01:24 AM

replace the

$allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
$newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");
right?

Boofo 09-04-2002 01:33 AM

Yes.

DarkDraco07 09-04-2002 01:40 AM

nope, people cant log in and i still cant log out

check it out www.darknemesis.com/forums

look at the members page and look at total members on forum home

DarkDraco07 09-04-2002 01:45 AM

just to make sure, for the members i need to backup which querys?

Boofo 09-04-2002 01:57 AM

How many members do you actually have? The code I gave you is for private messages. It shouldn't have anything to do with what seems to be happening. Somewhere in your index.php you have another problem. Either with a hack you installed or something. Like Erwin said, the only way to find out what it is is to compare it or start over with a fresh index.php and see if that fixes it.

Erwin 09-04-2002 02:04 AM

Yup. It has nothing to do with PM - the PM query is trying to find your bbuserinfo[userid] and other user information which is not being checked by index.php properly, hence your login problems.

DarkDraco07 09-04-2002 02:10 AM

NOOOO :( i hate vb!!! ahhhhh

is anyone willing to check my index.php file for me cuz...i cant seem to find a wrong variable. i searched line by line by copy/pasting in find and i cant seem to see whats wrong!!

and how come in the members page it has me and a random person on there

DarkDraco07 09-04-2002 03:45 PM

i guess thats a no...

DarkDraco07 09-04-2002 05:45 PM

i took a fresh index.php file and reinstalled EVERY hack that needed index.php. still have same problem.

for more info aobut my problem its like this...

if someone is logged out and logs in, it will show them as logged in and a guest at same time but they are not logged in.

if you are logged in (only me) and try to log out it shows u as a guest and as logged in at same time but you are logged in


All times are GMT. The time now is 07:38 PM.

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.01313 seconds
  • Memory Usage 1,795KB
  • 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
  • (5)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (28)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