MySQL Loading -
Abreezy - 26.05.2013
Hello,
I bought a new host, which is linux instead of my regular windows. I use the same plugins and everything, but for some reason, I'm having some technical difficulties. Everything is loaded one after So for Example:
Posx = 5 Posy = 10 Posz = 1
That is the way it should load, but instead it's loading:
Posx: -0.00000028 Posy = 5 Poz = 10
As you can see, its just loading one over the the right. On windows, this works perfectly. But on linux it doesn't so I'm not sure what's wrong. Below I will post a couple of lines from the script which loads it, so you can see if you could find the issue. Thanks in advance to anyone reading.
pawn Код:
format(myquery, sizeof(myquery), "SELECT * FROM saes_stopsigns");
mysql_query(myquery);
mysql_store_result();
new srows = mysql_num_rows();
for(new i=0; i < srows; i++) {
mysql_fetch_row_format(myquery, "|");
sscanf(myquery, "p<|>e<iffff>", StopSign[i]);
printf("Stop Signs %i ::: %f %f %f", i, StopSign[i][sPosX], StopSign[i][sPosY], StopSign[i][sPosZ]);
}
Is the code to load it, and the enums are:
pawn Код:
enum sData {
sID,
Float:sPosX,
Float:sPosY,
Float:sPosZ,
Float:sPosA,
sObjectID
}
new StopSign[500][sData];
That is the database order for the beginning of it just to know it is loading in order, but just not being set in order
Re: MySQL Loading -
[HiC]TheKiller - 27.05.2013
pawn Код:
mysql_query("SELECT * FROM saes_stopsigns");
mysql_store_result();
new i;
while(mysql_fetch_row_format(myquery, "|"))
{
sscanf(myquery, "p<|>e<iffff>", StopSign[i]);
printf("Stop Signs %i ::: %f %f %f", i, StopSign[i][sPosX], StopSign[i][sPosY], StopSign[i][sPosZ]);
i++;
}
Give that a go.
Re: MySQL Loading -
Abreezy - 27.05.2013
Quote:
Originally Posted by [HiC]TheKiller
pawn Код:
mysql_query("SELECT * FROM saes_stopsigns"); mysql_store_result(); new i; while(mysql_fetch_row_format(myquery, "|")) { sscanf(myquery, "p<|>e<iffff>", StopSign[i]); printf("Stop Signs %i ::: %f %f %f", i, StopSign[i][sPosX], StopSign[i][sPosY], StopSign[i][sPosZ]); i++; }
Give that a go.
|
Same issue. On a quick side note, would using the wrong plugin cause this? I feel as that might be the issue, the host might be using the wrong plugins/libraries since it works perfectly elsewhere, any ideas on that?
Re: MySQL Loading -
Kyle - 27.05.2013
What I do want to add is that some data he fetches
IS correct and some is not.
If it was a server issue I believe all the data would be invalid / couldn't grab any at all.
I believe it is down to scripting or using the depreciated R5 plugin.
I created a script using R7 caching and it works fine and advised him to upgrade to R7+.
Also I don't allow plugin uploads, I uploaded R5. It didn't work so I allowed him to give me his .so of the plugin and I added it for him and his version didn't work.
Re: MySQL Loading -
Scenario - 27.05.2013
I work with Latency Host on issues where they require someone with a little scripting knowledge to check something out. I went ahead and connected to your exact database using your username/password combination and I was able to get the data to print out correctly.
Therefore, this cannot be an issue on our end. The only thing I could think of would be some faults with the R5 version, or possibly even sscanf not loading the data properly. If you haven't already, I would try to update sscanf and make sure that Latency's version matches your include version.
If all else fails, I'm sure we can find another solution.
http://pastebin.com/Jmt59xzV - This code was compiled with R20 of BlueG's MySQL plugin.