Jump to content

[SOLVED] sorting information in php and mysql


curt22

Recommended Posts

I'm new to php and mysql and I need to have the results sorted.
First its needs to sort by book.
then by chapters inside the books.
Then by verse.
For example:
if its like this now:
id  testimate  book              chapter  verse
1    old            genesis          1              1
2    old            Exodus          2              1
3    old            genesis          2              2
it would look like this after being sorted:
1    old            genesis          1              2
3    old            genesis          2              2
2    old            Exodus          2              1
the code im using to show the databse is:
<?php
include 'connect.php';
$sql = 'SELECT * FROM bible WHERE MATCH($_post[\'field\'])'
        . ' AGAINST(\'$_post[\'find\']\'  IN BOOLEAN MODE) LIMIT 0, 30 ';
$result = mysql_query($sql) or die(mysql_error());

while($row = mysql_fetch_array($result)){
echo $row['testimate'] . " " . $row['book'] . " " . $row['chapter'] . " " . $row['verse'];
echo "<br/>";
}

?>
??? ??? ??? ??? ???
Link to comment
Share on other sites

Ok this is as much as i can get could you please tell me what to do with it?

<?php

include 'connect.php';
$query = "SELECT * FROM bible ORDER BY bookid";
$result = mysql_query($query) or die(mysql_error());

while($row = mysql_fetch_array($result)){
echo $row['testimate'] . " " . $row['book'] . " " . $row['chapter'] . " " . $row['verse'] . " " . $row['verse text'];
echo "<br/>";
}



?>
Link to comment
Share on other sites

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.