Log in

View Full Version : A little (more)help :)


Infernette
03-01-2013, 10:26 PM
Well, I'm making an adoptables selling sort of page, but the thing is, I cannot for the life of me figure how to get the mysql database from inserting $mysidia->user->username instead of the actual name when it updates the pet once it's purchased.

*!code removed to prevent usage until finished!* ;)


The problem is at the end, starts here "}
elseif($mysidia->input->action() == "purchase"){
" , posting whole code just in case it's something earlier on. :coloness:

-Also, I have to say thank you guys for all the previous help you've given 'newbie' me. It really helped me learn how to do this a lot better than staring at a couple of paragraphs. :smile:

Hall of Famer
03-01-2013, 11:18 PM
I did not look much into the detail, but it seems that there's something wrong with this line:


$mysidia->db->update("owned_adoptables", array("owner" => '{$user}',"selling" => 'no'), "aid ='$adopt->aid'");


which should be:


$mysidia->db->update("owned_adoptables", array("owner" => $user, "selling" => 'no'), "aid ='{$adopt->aid}'");

Infernette
03-01-2013, 11:26 PM
It still seems to not credit it to the right user (Instead it gives it to $user XD), and that is the line that is giving me the problem indeed... I'll spend some more time trying to figure what it's doing tomorrow to see if I can fix it on my own, hopefully.

Hall of Famer
03-02-2013, 12:53 AM
Well apparently you have another error in your mysql database update query. Find every instance of:


"owner" => '{$user}',


And replace by:


"owner" => $user,


If it still wont fix your problem, please post a screenshot and I will see what is causing the problem exactly. Also I am a bit confused at where exactly the error is. Does the script insert a row in database under the user '$user', or that it is just $user being displayed on the screen while nothing is abnormal from database?

Infernette
03-02-2013, 09:38 AM
Thanks, I got it to work. :smile:

Hall of Famer
03-02-2013, 04:09 PM
You are very welcome, glad to see that you are doing some serious customization for your site atm.

Infernette
03-02-2013, 05:20 PM
I have plans to set up a public breeding script now that I have this working. :)

Hall of Famer
03-02-2013, 08:01 PM
A breeding script? Thats interesting, I am actually working on an advanced breeding system for the next Mys v1.3.3 release. Will post details about it in a blog post in a few days, but Id like to know if people have other ideas in mind.