Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 19th Apr 2012, 08:07 AM   #1
HyperActive Warrior
 
Join Date: 2009
Posts: 212
Thanks: 11
Thanked 5 Times in 5 Posts
Default
php question
Share on: 
fb share twitter share gplus share more share

ok so I have a script that produces a list of clients in a database works fine - I have added a search box in an if statement

if (isset($_GET['search'])) {
$entry = $_GET['search'];

then I query the db and search for records according to the $entry

}

issue is down here under that if statment I have the normal query that brings back all the clients so what I'm getting when I search is the searched record + all the rest if I die(); in the if statement then obviously the page is messed up.. how can I get it to just show the searched records and how do you go about clearing the search to return to the normal records

solidsoul is offline  
Unread 19th Apr 2012, 08:20 AM   #2
VIP Warrior
War Room Member
 
Join Date: 2006
Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
Default
Re: php question
Share on: 
fb share twitter share gplus share more share

Uhmmm, don't do the full query if you have a search parameter.

"ELSE", Know it, Live it, Learn it.
KirkMcD is offline  
Unread 19th Apr 2012, 08:58 AM   #3
HyperActive Warrior
 
Join Date: 2009
Posts: 212
Thanks: 11
Thanked 5 Times in 5 Posts
Default
Re: php question
Share on: 
fb share twitter share gplus share more share

I've tried an else statement - what I was doing was as such

if (isset($_GET['search'])) {
excute search query
}
else {
and I was placing the normal query here that fetched all the clients and spit them out
}
then down here running the rest of the page

hmmm how to explain this the index.php file has java running when you click the buttons at the top it slides the screen over and shows another section of the index.php file.. so when I'm doing this else statement it's showing a section in the wrong place does that make sence...

solidsoul is offline  
Unread 19th Apr 2012, 06:45 PM   #4
Ultimate Profit Tools
War Room Member
 
Tradeout's Avatar
 
Join Date: 2011
Location: UK
Posts: 98
Thanks: 13
Thanked 44 Times in 31 Posts
Default
Re: php question
Share on: 
fb share twitter share gplus share more share

Can you show the rest of the code?

** note: make sure you cleanse the incoming data from the search input
Tradeout is offline  
Closed Thread


Bookmarks

Tags
php, question


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 12:00 PM.