Page 1 of 1

text search

Posted: Mon Aug 23, 2004 9:56 am
by rfigley
My queries so far have dealt with looking for an exactt text string in a given column:

Code: Select all

<?php
$query = ("select * from tbl_members where active!='No' and chapter='Chapter Name' AND unit='Lunch' order by 'category'");
?>
How would I change this to use a text box and search the "Chapter" field for a string similar to or starting with the text entered?

Posted: Mon Aug 23, 2004 10:03 am
by Joe

Code: Select all

$query = ("select * from tbl_members where active!='No' AND chapter='".$_POST['chapter']."' AND unit='Lunch' ORDER BY category");
Make sure the previous form has a post method and of course an element named chapter.

Posted: Mon Aug 23, 2004 10:08 am
by rfigley
At the risk of looking like too much of a beginner (Idiot?) can you show an example of an appropriate "Post" method?

Posted: Mon Aug 23, 2004 10:09 am
by Joe
Like:

Code: Select all

Form Action:
<form action="script.php" method="POST" />

Element:
<input type="text" name="category" />