Jump to content

blank query result when using order by


AV1611

Recommended Posts

this works fine, but not in the correct order
[code]
("Select * From bible where `$WhichBook` Like '$BOOK' and `chapter` like $CHAPTER")
[/code]
this HAS NO RETURNS!
[code]
("Select * From bible where `$WhichBook` Like '$BOOK' and `chapter` like $CHAPTER" ORDER BY `key` ASC)
[/code]


here is the table structure:

[code]
CREATE TABLE `bible` (
  `key` int(6) NOT NULL default '0',
  `book` varchar(255) default NULL,
  `chapter` varchar(255) default NULL,
  `verse` varchar(255) default NULL,
  `scripture` longtext,
  `spbook` varchar(255) default NULL,
  `spanish` longtext,
  `scripture2` longtext,
  PRIMARY KEY  (`key`),
  UNIQUE KEY `MAIN` (`key`),
  UNIQUE KEY `SECOND` (`book`,`chapter`,`verse`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='InnoDB free: 1418240 kB; InnoDB free: 1415168 kB; InnoDB fre'

[/code]
you missed the closing " quote off the end of your query, as you put the ORDER BY outside of your original quote:

[code]
("Select * From bible where `$WhichBook` Like '$BOOK' and `chapter` like $CHAPTER ORDER BY `key` ASC");
[/code]
That would explain why mysql_error missed it....

Thanks...

That's what happens when you are tired...

[!--quoteo(post=354850:date=Mar 14 2006, 07:16 AM:name=redbullmarky)--][div class=\'quotetop\']QUOTE(redbullmarky @ Mar 14 2006, 07:16 AM) [snapback]354850[/snapback][/div][div class=\'quotemain\'][!--quotec--]
you missed the closing " quote off the end of your query, as you put the ORDER BY outside of your original quote:

[code]
("Select * From bible where `$WhichBook` Like '$BOOK' and `chapter` like $CHAPTER ORDER BY `key` ASC");
[/code]
[/quote]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.