SQL select - 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: SQL select (
/showthread.php?tid=598323)
SQL select -
Squirrel - 11.01.2016
Sorry its me again, I have been spamming forums tonight for help (sorry for that its Just I suck)
Well this gives me no results. Almost none....
PHP код:
new query[256];
mysql_format(mysql, query, sizeof(query),"SELECT `Reason`, `Date` FROM `crimes` WHERE `Name`='%e'",somename);
mysql_tquery(mysql, query, "OnCrimeLoad");
PHP код:
forward OnCrimeLoad();
public OnCrimeLoad()
{
new reason[128],SomeDate,rows = cache_num_rows(),string[128],crimecount;
for(new i=0; i < rows; i++)
{
cache_get_field_content(i, "Reason", reason);
format(reason, sizeof(string), string);
SomeDate = cache_get_field_content_int(i, "Date");
printf("%s|%d", string, SomeDate);
crimecount++;
}
printf("Test hi %i",crimecount);
return 1;
}
Re: SQL select -
Squirrel - 11.01.2016
Okay so I resolved all issues besides 1. The string im getting is entirely empty....
PHP код:
cache_get_field_content(i, "Reason", reason, 64);
format(reason, sizeof(string), string);
Msg(playerid,COLOR_GREEN,string);
Re: SQL select -
Squirrel - 11.01.2016
FIXED