logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Video Tutorials
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 02-15-2007, 09:27 PM   #1
Violenteer
 
Join Date: Feb 2007
Posts: 3
Default Ajax. Couple of questions.

Thanks for tutorials.

So much easier on Video! Though do have a question.

If I have five drop down boxes using ajax, or for that matter not using ajax. Each of these is directly underneath each other, and appears using ajax based on the previous selection.

The question is. Can the user make a search at time any time, and have a seperate search button come up each time, next to that box, and correspondingly move down the line of boxes as they appear. So effectively they choose the complexity of their search?

Another question: When I get to my third last box, the choices require that sometimes the fourth list/dropdown be bypassed and goes straight to the otpions presented in the fifth. How do I work it so that in this instance the fifth box actually appears in place of the fourth (in the fourth box position, but with fifth box options)?

Also am confused over how to get data, i.e.: name, number, web adress, email from the database into a sexy web format!

Thanks Again,

Cameron.

Last edited by Violenteer; 02-16-2007 at 06:03 AM..
Violenteer is offline   Reply With Quote
Old 02-16-2007, 06:36 AM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

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'];
 
if(
$id){$SQL "id ='".$id."'";}
 
if(
$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 -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 02-16-2007, 06:43 AM   #3
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

Quote:
Also am confused over how to get data, i.e.: name, number, web adress, email from the database into a sexy web format!
where ever you echo your db $var just style the $var with CSS

example...
HTML Code:
<span class="dbstyle"> <?php echo $row['db_column']; ?> </span>
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 06:18 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com