Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2012, 12:06 AM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 81,215
SilverDragonTears is on a distinguished road
Default Order by?

How do I order this by itemname? I still don't quite understand the new coding :/

Code:
	
	  $stmt = $GLOBALS['adopts']->select("items", array(), "shop ='{$this->shopname}'");
__________________

Check out SilvaTales
Reply With Quote
  #2  
Old 04-20-2012, 04:26 AM
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: 327,454
Hall of Famer is on a distinguished road
Default

Well just pass ORDER BY to the whereclause, if you have a whereclause. Incase you do not have a whereclause(and thus selecting all rows), you can do the following:

PHP Code:
$stmt $GLOBALS['adopts']->select("items", array(), "1 ordered by itemname"); 
It may look a bit funny, but the magical keyword '1' does the trick for ya.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 05-02-2012, 12:24 AM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 81,215
SilverDragonTears is on a distinguished road
Default

This isn't ordering by cost...
Code:
    $stmt = $adopts->join("adoptables_conditions", "adoptables_conditions.id = adoptables.id")
				   ->select("adoptables", array(), "breed = 'short'", "1 ordered by cost ASC");
__________________

Check out SilvaTales
Reply With Quote
  #4  
Old 05-02-2012, 05:28 AM
fadillzzz fadillzzz is offline
Dev Staff
 
Join Date: Jan 2010
Posts: 501
Gender: Male
Credits: 32,504
fadillzzz is an unknown quantity at this point
Default

@Silver Kitsune
Yeah sorry about that. The new release will include a much better database class. Although I won't say that it's comprehensive or anything, but it should suffice for most of the needed queries.

But anyway, the right keyword is ORDER BY not ORDERED BY.
Reply With Quote
  #5  
Old 05-02-2012, 10:51 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: 327,454
Hall of Famer is on a distinguished road
Default

Oh my goodness, made a typo in that php code I wrote. Didnt realize that since I did say 'ORDER BY' at the beginning of my post, did I? XD
__________________


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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to order adoptables? Lonin Questions and Supports 2 05-10-2012 01:58 PM
order Available Adoptables list bluez Questions and Supports 4 06-21-2011 01:59 PM


All times are GMT -5. The time now is 12:05 PM.

Currently Active Users: 456 (0 members and 456 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636