sqlite read issue
#1

Hello,

I am trying to read from my database here. As you can see i tried many things XD (if you look at the // )


pawn Код:
ReadVehicle(playerid);
public ReadVehicle(playerid)
{
    new query[256],string[128];
    new DBResult:qresult;
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
//SELECT vehicleinfo FROM vehicleinfo WHERE username = '%s' AND slotid = %d", pname, slotid);
    //format(string,sizeof(string),"SELECT Level FROM `users` WHERE Username = '%s'", PlayerName[playerid]);
    //format(query,sizeof(query),"SELECT stat FROM `Users` WHERE `Name`= '%s'",pName);
    //format(query,sizeof(query),"SELECT Name FROM `Users` WHERE `Name`= '%s'",pName);
   
    //format(query, sizeof(query), "SELECT Users FROM Users WHERE name = '%s'",pName);
    format(query, sizeof(query), "SELECT Users FROM `Users` WHERE name = '%s'",pName);
    qresult = db_query(testdb,string);
   
    //if(db_num_rows(qresult) == 1)
   // {
        db_get_field_assoc(qresult,"name",string,6);
        format(string,sizeof(string),"%s",strval(string));
        SendClientMessage(playerid,0xAFAFAFAA,string);
    //}
    db_free_result(qresult);
}
I'm very confused now and i need help, i just want it to read the name out of the database and sends a clientmessage to confirm that it did. All it does now is sending an empty string

Thanks in advance
Reply


Messages In This Thread
sqlite read issue - by boelie - 14.03.2012, 17:19
Re : sqlite read issue - by Cyril59 - 14.03.2012, 18:53
Re: sqlite read issue - by boelie - 14.03.2012, 19:20
Re: sqlite read issue - by boelie - 16.03.2012, 12:26

Forum Jump:


Users browsing this thread: 1 Guest(s)