Raised This Month: $32 Target: $400
 8% 

My SQL Menu Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shadowdragon
Senior Member
Join Date: Dec 2012
Old 12-15-2014 , 06:42   My SQL Menu Help
Reply With Quote #1

Hello all alliedmodders i am trying to display data from a mysql database into a menu the method im using gives me no errors but nothing happens when i type the command to open the menu

PHP Code:
LoadTrailList(client)
{
    new 
String:query[255];
    
Format(querysizeof(query), "SELECT * FROM trail_items WHERE trailname='%s'",TrailName[client]);
    
    
SQL_TQuery(hDatabaseLoadTrailsquery_);

PHP Code:
public LoadTrails(Handle:ownerHandle:hndl, const String:error[], any:client)
{
    if (
hndl == INVALID_HANDLE)
    {
        
PrintToServer("Failed to query (error: %s)"error);
    } 
    else 
    {
        new 
Handle:menu CreateMenu(store_handler);
        
SetMenuTitle(menu"laserTEAMgamers \n Store v0.1A \n Credits: %i"credits[client]);
        while (
SQL_FetchRow(hndl))
        {
            
TrailName[client] = SQL_FetchString(hndl1TrailName[client], sizeof(TrailName));
            
//new TrailCost;
            //new String:TrailPath;
            
AddMenuItem(menuTrailName[client], TrailName[client]);
        }
        
SetMenuExitButton(menutrue);
        
DisplayMenu(menuclient50);
    }

Any code example would be really sweet im more of a hand on learner

Sorry for my poor english
__________________
Sorry for my poor English!
________________________________
I can do CSS/CSGO plugin request for little money!
shadowdragon is offline
splewis
Veteran Member
Join Date: Feb 2014
Location: United States
Old 12-17-2014 , 16:38   Re: My SQL Menu Help
Reply With Quote #2

You're callback has the client parameter passed, but when you do the SQL_TQuery you're not actually passing the client. (so change _ to client)

You should probably also use client serials instead of client indices when doing something timed/asynchronous.
__________________
splewis is offline
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 -4. The time now is 23:25.


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