View Single Post
Old 02-16-2007, 06:36 AM   #2
davidj's Avatar
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256

the thing to remember here is that ajax allows for database calls without a page refresh. So this question has nothing to do with ajax.

your question relates to search complexity

what i have done before is catch the form values as normal but build up the SQL dynamicaly so lets take this example...

PHP Code:
$id $_POST['id'];
$id2 $_POST['id2'];
select from table where id '$id' and id2 '$id2' 
and change it to this...

PHP Code:
$id $_POST['id'];
$id2 $_POST['id2'];
$id){$SQL "id ='".$id."'";}
$id2){$SQL .= "and id2 ='".$id2."'";}
select from table where '$SQL' 
This means your WHERE clause is created dynamicaly
Would you like to learn PHP from me? Check out ->
davidj is offline   Reply With Quote