Issue with SQL
#1

pawn Код:
public LoadCar()
{
    new file[26];
    for(new idx = 1; idx < sizeof(CarInfo) ; idx++)
    {
        format(file,sizeof(file),"SELECT `ownedcars` WHERE `id` = '%d'", idx);
        mysql_query(file);
        if(mysql_query(file))
        {
            CarInfo[idx][cModel] = mysql_query(file,"Model");
Error is on: CarInfo[idx][cModel] = mysql_query(file,"Model");

Can you tell me, what did I do wrong, looks ok to me?

error 035: argument type mismatch (argument 2)
Reply
#2

Go read some tutorials on using MySQL. Also note that your string "file" is too short. The query itself is 36 characters long, you need a string of at least 40 to account for the possible ID's and the null terminator.
Reply
#3

You're seriously going to send a SELECT query for every single vehicle..? You're also sending the same query twice, and a third time you're sending the query "Model" (which isn't even a query).

As RealCop said, don't try and guess how to use mySQL - go read a tutorial, go download a mySQL-based gamemode or something, just don't do that..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)