bdrever
-
Posts
7 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by bdrever
-
-
Thanks for the help I got it figured out!
-
I need some tips for how to display search results.Querying the database is not the issue I just have no idea how to display the results.I want to display the results in a table, 3 columns of 4 rows, so 12 results per page. I don't know how to do this. Would I make some sort of nested loop?Also, if I have more than 12 results I want to spread them over multiple pages. This I also have no clue how to do.I welcome any and all suggestions.Thanks guys!
-
thanks for pointing me in the right direction. I really did not know where to beginIf you want to use Javascript, you need to have PHP write out the entire database at once. So PHP would create a big array in Javascript of all the possible values. The other way is to use AJAX to have Javascript send a request to a PHP page on the server, which would get the data and send it back to update the page. It's a little more complex, and a little heavier on the database, but it works well. If you are interested in that, do a Google search for AJAX to learn more. -
Thanks for the heads up!I've managed to create a form that will populate the second dropdown list, based on the user input of the first, but only AFTER the submit button has been pressed. How can I make it do it upon changing the information in the first box?I thought of using the javascript onChange event handler but I am not sure how to pass the value from js into php which I need to do in order to query my db..Any ideas? I was dreaming about this lastnight and thought I had a solution but I doesn't work.Look in the PHP or Javascript forums, that question gets answered several times per week it seems like.<?php$brand = $_POST['CarMfg'];$query = "SELECT mfg, model FROM test.cars WHERE mfg = '$brand'";$result = mysql_query($query);?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Untitled Document</title></head><body><form name ="test" method="post" action="ListTest.php">phone : <select name="CarMfg" onchange="update()"> <option value="" selected><?php print $brand; ?></option> <option value ="Ford">Ford</option> <option value ="Dodge">Dodge</option> <option value ="GMC">GMC</option> </select><br> <br>model: <select name"model"><?php while ($row = mysql_fetch_assoc($result)) { print '<option value="'; print $row['model']; print '">'; print $row['model']; print '</option>'; }?></select><br><br><input type="submit" value="submit"></form></body></html>
-
Hi guys,I would like to create a form that pulls data from a database and displays the values it pulls as elements in a select style dropdown list. Any tips on how to do this?Example:The first dropdown box the user selects a type of food: PizzaThe next dropdown box automatically fills with different kinds of pizza i.e pepperoni, cheese, etc..
Help me clean up/compact my echo's
in PHP
Posted
figured it out.. sorry