Jarrod
Sorceror
MyRunUO data to MySQL db issue (PHP)
Hi all,
No this isnt a "omg how i do instal thiz!?" thread, so back away from the [FLAME] key
I have everything installed on the server.
Im using Apache
Im using PHP script release (not .asp files)
the MySQL database is set up and works beautifully. I can query it to death, no errors.
the MyRunUO distro scripts are in place and active.
the .php files also work and can query the DB, but return no values, as the tables are empty.
thats the problem. MyRunUO is not feeding the database. I started to track what the problem could be.
As status is the entry page, i started with that.
in MyRunUOStatus.cs at line 58 i found the following:
m_Command.Enqueue( String.Format( "INSERT INTO myrunuo_status() VALUES ({0})", mob.Serial.Value.ToString() ) );
???
inserting the value into WHAT?? and where are location, map, karma, and fame?
running something like that on the mySQL directly would throw errors as well. the syntax is wrong. I changed it to this:
m_Command.Enqueue( String.Format( "INSERT INTO myrunuo_status(char_id, char_location, char_map, char_karma, char_fame) VALUES ({0}, {1}, {2}, {3}, {4})", mob.Serial.Value.ToString(), null, mob.Map, mob.Karma, mob.Fame ) );
So. now we know what should be entered where. However, when running this, its still not giving any info into the database. (root does have access to the DB, so its not an access thing i think)
So i added a console line to see what exactly its trying to feed the DB:
the result when i enter [updatemyrunuo :
so i see it is reading the values correctly.... but in the database there is still no information...
at least in the MyRunUO.cs the values are correct on INSERT
ExecuteNonQuery( "INSERT INTO myrunuo_characters (char_id, char_name, char_str, char_dex, char_int, char_female, char_counts, char_guild, char_guildtitle, char_nototitle, char_bodyhue, char_public ) VALUES ({0}, '{1}', {2}, {3}, {4}, {5}, {6}, {7}, {8}, '{9}', {10}, {11})", mob.Serial.Value.ToString(), SafeString( mob.Name ), mob.RawStr.ToString(), mob.RawDex.ToString(), mob.RawInt.ToString(), female, mob.Kills.ToString(), guildId, guildTitle, notoTitle, mob.Hue.ToString(), pubString );
so i know the values are good in the .cs files... the MySQL database (MyRunUO) is also fine.. where could the problem be originating from that the data sets are not being fed into the database? the Console isnt showing any errors at all.
Thanks in advance.
Hi all,
No this isnt a "omg how i do instal thiz!?" thread, so back away from the [FLAME] key
I have everything installed on the server.
Im using Apache
Im using PHP script release (not .asp files)
the MySQL database is set up and works beautifully. I can query it to death, no errors.
the MyRunUO distro scripts are in place and active.
the .php files also work and can query the DB, but return no values, as the tables are empty.
thats the problem. MyRunUO is not feeding the database. I started to track what the problem could be.
As status is the entry page, i started with that.
in MyRunUOStatus.cs at line 58 i found the following:
m_Command.Enqueue( String.Format( "INSERT INTO myrunuo_status() VALUES ({0})", mob.Serial.Value.ToString() ) );
???
inserting the value into WHAT?? and where are location, map, karma, and fame?
running something like that on the mySQL directly would throw errors as well. the syntax is wrong. I changed it to this:
m_Command.Enqueue( String.Format( "INSERT INTO myrunuo_status(char_id, char_location, char_map, char_karma, char_fame) VALUES ({0}, {1}, {2}, {3}, {4})", mob.Serial.Value.ToString(), null, mob.Map, mob.Karma, mob.Fame ) );
So. now we know what should be entered where. However, when running this, its still not giving any info into the database. (root does have access to the DB, so its not an access thing i think)
So i added a console line to see what exactly its trying to feed the DB:
PHP:
if ( mob != null )
{
m_Command.Enqueue( String.Format( "INSERT INTO myrunuo_status(char_id, char_location, char_map, char_karma, char_fame) VALUES ({0}, {1}, {2}, {3}, {4})", mob.Serial.Value.ToString(), null, mob.Map, mob.Karma, mob.Fame ) );
Console.WriteLine( "adding {0}, {1}, {2}, {3}, {4})", mob.Serial.Value.ToString(), null, mob.Map, mob.Karma, mob.Fame);
}
the result when i enter [updatemyrunuo :
PHP:
MyRunUO: Status database updated in 0,0 seconds
adding 22242, , Felucca, 0, 1806)
adding 3630, , Felucca, 12506, 15000)
MyRunUO: Updating character database
MyRunUO: Characeter database updated in 0,0 seconds
MyRunUO: Database statements compiled in 0,78 seconds
so i see it is reading the values correctly.... but in the database there is still no information...
at least in the MyRunUO.cs the values are correct on INSERT
ExecuteNonQuery( "INSERT INTO myrunuo_characters (char_id, char_name, char_str, char_dex, char_int, char_female, char_counts, char_guild, char_guildtitle, char_nototitle, char_bodyhue, char_public ) VALUES ({0}, '{1}', {2}, {3}, {4}, {5}, {6}, {7}, {8}, '{9}', {10}, {11})", mob.Serial.Value.ToString(), SafeString( mob.Name ), mob.RawStr.ToString(), mob.RawDex.ToString(), mob.RawInt.ToString(), female, mob.Kills.ToString(), guildId, guildTitle, notoTitle, mob.Hue.ToString(), pubString );
so i know the values are good in the .cs files... the MySQL database (MyRunUO) is also fine.. where could the problem be originating from that the data sets are not being fed into the database? the Console isnt showing any errors at all.
Thanks in advance.