SA-MP Forums Archive
Can't get data from table - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can't get data from table (/showthread.php?tid=577627)



Can't get data from table - nezo2001 - 12.06.2015

I am trying to get data from another table and I did this
PHP код:
    new query[128];
    
format(query,sizeof(query), "SELECT * FROM houses");
    
mysql_query(1query);
    new 
rows cache_affected_rows();
    
printf("%i house(s) loaded"rows); 
And I got
Код:
0 house(s) loaded



Re: Can't get data from table - DarkLored - 12.06.2015

You are only selecting but you do not mention what you are trying to select in your code


Re: Can't get data from table - Konstantinos - 12.06.2015

If you want to just count how many rows there are:
pawn Код:
new Cache: result = mysql_query(1, "SELECT COUNT(*) FROM houses");
printf("%i house(s) loaded", cache_get_row_int(0, 0));
cache_delete(result);



Re: Can't get data from table - nezo2001 - 12.06.2015

Dark: I want to select all data from the table
Konstantinos: I will try
Edit: Worked Thanks Kon