View Single Post
  #6  
Old 04-09-2012, 09:54 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 588,836
Hall of Famer is on a distinguished road
Default

I see, glad it works out nicely, thought your members will be angry at the fact that they have to start over again. I do recommend you to be careful next time, you have an active site running already so the cost of rebuilding your site is immensely high compared to those who do not have much activity going on.

Actually the old code still works, you can write $query = "' and run it with $adopts->query(). Thats the beauty of the database class, it has backward compatibility. The new methods are really easy to use though, if you want to learn. The below code demonstrates such an example:

PHP Code:
$row $adopts->join("users_status""users_status.uid = users.uid")->join("users_profile""users_profile.uid = users.uid")
                ->
join("users_options""users_options.uid = users.uid")->join("users_contacts""users_contacts.uid = users.uid")
                ->
select("users", array(), constant("PREFIX")."users.username = '{$user}'")->fetchObject(); 
So the script means you are joining the table users, users_contacts, users_options, users_profile and users_status with records that share the same user id, the where clause is username = $user. Note the current join() method has a tiny bit of problem, as you have to use ".constant('PREFIX')." in the statement. The idea of this database class is to get rid of having to play with table prefixes though, and we will fix it soon.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.