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(query, sizeof(query), "SELECT * FROM trail_items WHERE trailname='%s'",TrailName[client]);
SQL_TQuery(hDatabase, LoadTrails, query, _);
}
PHP Code:
public LoadTrails(Handle:owner, Handle: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(hndl, 1, TrailName[client], sizeof(TrailName));
//new TrailCost;
//new String:TrailPath;
AddMenuItem(menu, TrailName[client], TrailName[client]);
}
SetMenuExitButton(menu, true);
DisplayMenu(menu, client, 50);
}
}
Any code example would be really sweet im more of a hand on learner
Sorry for my poor english
__________________