Author Topic: [ SERIOUS ISSUES WITH pet_engine.php ]  (Read 2996 times)

Offline JusPlay77

[ SERIOUS ISSUES WITH pet_engine.php ]
« on: February 29, 2008, 05:36:49 pm »
SMF 1.1.4
SMF Shop Mod 3 (Build 12)
SMF Pets Version 0.2
SMFShop Inventory Post Mod  Version 0.2
SMFShop Stats Mod Version 0.1

\---------------------\

My shop all of a sudden stopped working over night.  I hadn't changed anything in the code prior (It was working, and when I came back to further train my pet I got the following error:

Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's the best! Built for Battle!',
hunger = 8,
age = 1,
' at line 7
File: /home/content/x/x/x/xxxxx/html/smf/Sources/shop/pet_engine.php
Line: 305

On top of that, my pet is somehow 21 days old and Very Depressed / Starving.  (I can still see my pet through my UserCP). My pet in actuality is only 2-3 days old.

I have attached the code of the pet_engine.php to this thread:

----

Furthermore, the section that it says it has a problem with is here:

Code: [Select]
290 //Store the values back into the database(very important)
291 function store_values() {
292 global $db_prefix;
293 $result = db_query("UPDATE {$db_prefix}shop_pets
294 SET name = '{$this->name}',
295     level = {$this->level},
296     curap = {$this->curap},
297     maxap = {$this->maxap},
298     happy = {$this->happy},
299     `desc` = '{$this->desc}',
300     hunger = {$this->hunger},
301     age = {$this->age},
302     training = {$this->training},
303     trainingend = '{$this->trainingend}',
304     ownerid = {$this->ownerid}
305     WHERE pet_id = {$this->id}", __FILE__, __LINE__);
306 }

Thanks in advance 
« Last Edit: March 01, 2008, 08:17:55 am by JusPlay77 »

Offline JusPlay77

Re: [ SERIOUS ISSUES WITH pet_engine.php ]
« Reply #1 on: March 01, 2008, 06:48:29 am »
This is what my db looks like.. dunno if there is anything missing?  or if something extra needs to be done to it or the php code? 





If anyone knows how to fix this, please respond.- This error is affecting my entire Shop-- nothing works with this error in play
« Last Edit: March 01, 2008, 09:02:26 am by JusPlay77 »

Offline Faust

Re: [ SERIOUS ISSUES WITH pet_engine.php ]
« Reply #2 on: March 02, 2008, 12:10:42 pm »
Is this the description of your pet ?

Quote
near 's the best! Built for Battle!

because if it is, then that is the problem, the ' is not properly escaped in the query, for the time being just go find your pet in the db and remove the ' in the description at near's

I am working on fixing the query