Jump to content

Not sure what is wrong


Attila

Recommended Posts

I am using a form so the user can search the database.  everything is working except the order at which items are searched.  I beleive it could be my coding but I am not seing a problem.

$sql = "SELECT * FROM ddoitems WHERE ItemDescription LIKE '%$item%' OR ItemName LIKE '%$item%' OR ItemType LIKE '%$item%' OR QuestName LiKE '%$item%' ORDER BY '%$Advance%' ASC";

The part that is not working ins the $Advance ASC it is not ordering things.  I know that $Advance is getting the information corectly to sort it because I have an echo statement to echo the value.

Link to comment
https://forums.phpfreaks.com/topic/118864-not-sure-what-is-wrong/
Share on other sites

$sql = "SELECT * FROM ddoitems

        WHERE ItemDescription LIKE '%$item%'

          OR

        ItemName LIKE '%$item%'

          OR

        ItemType LIKE '%$item%'

          OR

        QuestName LIKE '%$item%'

            ORDER BY '%$Advance%' ASC";

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.