Jump to content

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]
Link to comment
https://forums.phpfreaks.com/topic/4889-blank-query-result-when-using-order-by/
Share on other sites

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]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.