cheechm Posted September 9, 2008 Share Posted September 9, 2008 It doesn't seem to want to order: $sql = "SELECT name,type FROM config WHERE `section` = ". $section ." AND `show` = 1 AND `setting` = '" . $setting . "' ORDER BY type DESC"; Type = 0 or 1 or 2 Thanks Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 9, 2008 Share Posted September 9, 2008 So, what do the results look like? Are they ordered at all? Try putting backquotes around all field names. Type may be interpreted as a reserved word instead of a column name. Quote Link to comment Share on other sites More sharing options...
cheechm Posted September 9, 2008 Author Share Posted September 9, 2008 I will try even changing the field name. Quote Link to comment Share on other sites More sharing options...
cheechm Posted September 9, 2008 Author Share Posted September 9, 2008 Nope, doesn't work Quote Link to comment Share on other sites More sharing options...
xoligy Posted September 9, 2008 Share Posted September 9, 2008 Personally i didnt think you needed ".$section." i thought just '$section' worked maybe im wrong also where you have `setting` you have it like `setting`= '".$setting."' once again shouldnt just '$setting' work? like i said maybe im wrong Quote Link to comment Share on other sites More sharing options...
cheechm Posted September 9, 2008 Author Share Posted September 9, 2008 Maybe so, but that shouldn't make a difference to the ORDER BY command should it? Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 9, 2008 Share Posted September 9, 2008 You didn't answer my first question. Are the results ordered in any fashion? Can you show a representative sample of the results? Quote Link to comment Share on other sites More sharing options...
xoligy Posted September 9, 2008 Share Posted September 9, 2008 Here is one of my querys have to admit its a little long lol $query = "SELECT `id`, `mid`, `title`, `author`, `post`, DATE_FORMAT(`date`, '%M %D, %Y') as `date`, TIME_FORMAT(`time`, '%H:%i %p') as `time` FROM `news` ORDER BY `id` DESC LIMIT 50" cause you dont have to have limit x i normally use the myphpadmin tool to do the querys find it a little easier Quote Link to comment Share on other sites More sharing options...
cheechm Posted September 9, 2008 Author Share Posted September 9, 2008 The results aren't ordered at all. name show type section Home Page Text Box 0 0 0 Site Name 1 0 1 Site Online? 1 1 1 Your Postcode: 1 0 0 Your Phone number: 1 0 0 Your Address 1 0 0 Delivery Charge (/mile) 1 0 0 Subtitle 1 0 1 Email Confirmation Required 1 1 1 Quote Link to comment Share on other sites More sharing options...
xoligy Posted September 9, 2008 Share Posted September 9, 2008 yes they are lol it goes from 0 to 1 then 2 edit looked at wrong section, i think 0.o you have something wrong somewhere can you goto myphpadmin and do a sql dump and post that be easier too read Quote Link to comment Share on other sites More sharing options...
cheechm Posted September 9, 2008 Author Share Posted September 9, 2008 INSERT INTO `config` (`value`, `setting`, `name`, `show`, `input`, `section`) VALUES ('insurance value...\r\npat testing\r\nfield company\r\ninvoice table', 'home', 'Home Page Text Box', 0, 0, 0), ('Point', 'name', 'Site Name', 1, 0, 1), ('1', 'online', 'Site Online?', 1, 1, 1), ('1414', 'postcode', 'Your Postcode:', 1, 0, 0), ('077777', 'phone', 'Your Phone number:', 1, 0, 0), ('London', 'address', 'Your Address', 1, 0, 0), ('1.50', 'delivery', 'Delivery Charge (/mile)', 1, 0, 0), ('• Cool Test', 'subtitle', 'Subtitle', 1, 0, 1), ('1', 'email_confirm', 'Email Confirmation Required', 1, 1, 1); Quote Link to comment Share on other sites More sharing options...
xoligy Posted September 9, 2008 Share Posted September 9, 2008 Nah seems the dump is ok, after all so def the query i wouldnt think it cared but maybe its because not all your items are in 'x' $sql = "SELECT `name,`type` FROM `config` WHERE `section` = '$section' AND `show` = '1' AND `setting` = '$setting' ORDER BY `type` DESC"; try that if that fails have to wait for someone else to reply sorry :/ Quote Link to comment Share on other sites More sharing options...
cheechm Posted September 9, 2008 Author Share Posted September 9, 2008 Doesn't want to budge Quote Link to comment Share on other sites More sharing options...
xoligy Posted September 9, 2008 Share Posted September 9, 2008 only other thing i can suggest the query as follows: $sql = "SELECT `name,`type` FROM `config` WHERE `show` = '1' AND`section` = '$section' AND `setting` = '$setting' ORDER BY `type` DESC"; Quote Link to comment Share on other sites More sharing options...
cheechm Posted September 10, 2008 Author Share Posted September 10, 2008 Nothing has worked :@ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.