Raised This Month: $ Target: $400
 0% 

PHP problem (MySQL query with GET Variable)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Schwabba
Senior Member
Join Date: Apr 2008
Old 04-29-2011 , 08:09   PHP problem (MySQL query with GET Variable)
Reply With Quote #1

Hi,

i know it's a forum for Pawn problems, but it's known for common knowledge, so i'll try it here.

I made a Plugin with Pawn (and that's the clue why i can post it here! xD) and build a website now where you can view some stats etc, i try to start a toplist from X place to X+50 with GET.

PHP Code:
    if(!$HTTP_GET_VARS[site])
    {
        
$query="SELECT * FROM `furienmoney` ORDER BY `furienmoney`.`ac_total` DESC LIMIT 50";
    }
    else
    {
        
$site $HTTP_GET_VARS[site]; // does'nt work
        
$site2 = (int)$HTTP_GET_VARS[site]; // does'nt work
        
$query="SELECT * FROM `furienmoney` ORDER BY `furienmoney`.`ac_total` DESC LIMIT ' . $site2 . ',50";
    } 
I tried many different ways with ' . $var . ', '$var' etc., nothing worked, i always get:

PHP Code:
Warningmysql_numrows(): supplied argument is not a valid MySQL result resource in /usr/www/users/pingst/achievement/players.php on line 64 
And when i try to use an integer instead of a variable, it works fine. But i have to use the variable.


Hope someone can help, thx.
Schwabba is offline
 



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 -4. The time now is 04:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode