1

I'm looking for my sql table to perform a sort, but only if the search form has not been sent.

Can someone help me with the correct syntax please?

 <th><?php if(!isset($_POST['search'])) { echo "<a href='?orderby=FirstName&order="$firstOrder";' }?>">First Name</a></th>

Thanks

2
  • 1
    <th><?php if(!isset($_POST['search'])) { echo "<a href='?orderby=FirstName&order=".$firstOrder."'>First Name</a>"; }?></th> chheck and let me know Commented Jul 3, 2016 at 11:02
  • What error you got Commented Jul 3, 2016 at 11:02

1 Answer 1

2

You have to look around quotes changes. Do like below:-

<th><?php if(!isset($_POST['search'])) { echo "<a href='?orderby=FirstName&order=".$firstOrder."'>First Name</a>"; }?></th>
Sign up to request clarification or add additional context in comments.

2 Comments

That works... thank you. The issue i have now, is that it doesn't show a title when the search is used. Any idea how i should still show the column titles ?
@Tatws24 please ask a new question with providing your full code and what you want. Right now it's impossible to suggest without checking your code.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.