Jump to content

sort results by another column


rhock_95

Recommended Posts

what I am hoping to do is just reuse the original query and run a second query using the original $query (variable)

 

what I am seeking is the correct syntax

 

 $sql="select * from  my_table  where last='$query' and first LIKE '%$first%' ORDER BY first";

 

the above is not working

 

"$query is the original "last name" searched for

i don't understund your problem

is user input full last name or just part of it

is user input somethin from first name

can you post some example what user input, and what script must return

 

The initial query posts (last)  last and returns the records that match the "$query"

 

what I'm trying to do is run a second query (from an integrated form $first) that when submitted sorts the initial results by a second column (first)...where the second query input can be just a single letter (first initial etc)...

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.