yukafluck Posted June 3, 2009 Share Posted June 3, 2009 I have a small form on one of my pages that then calls the page again with a variable. I have the link set up that when it goes to the page it starts off with: vehicles_list.php?yearnarrow=_% [code=php:0] this way it starts showing all of the vehicles listed, but when it runs, I have it show the year that has been selected, but when it starts it shows the %. How can I do it so that it shows as "All" instead of the %? here is the code that I am working with: [code=php:0] <form name="Year" id="Year"> <select name="YearMenu" onchange="MM_jumpMenu('parent',this,0)"> <option selected="selected"><?php echo $yearnarrow?></option> <?php include_once "_functions/db_info.php"; //connect to database $dbserver = mysql_connect($hostname, $dbuser, $dbpswd); $connection = $dbserver or die ('I cannot connect to the server'); mysql_select_db ($dbname) or die ('I cannot connect to the database'); $sqlGetVehicleYear="SELECT COUNT(*) num, vehicle_year FROM vehicles GROUP BY vehicle_year DESC; "; $sqlGetVehicleYearRes = mysql_query($sqlGetVehicleYear,$connection) or die ("could not connect to sqlGetVehicleYear "); While ($row = mysql_fetch_array($sqlGetVehicleYearRes)) { $vehicle_year=$row["vehicle_year"]; ?> <option value="vehicles_list.php?makenarrow=%&typenarrow=%&yearnarrow=<?php echo $vehicle_year ?>"><?php echo $vehicle_year ?> (<?php echo $row['num']; ?>)</option> <?php }?> </select> </form> Link to comment https://forums.phpfreaks.com/topic/160834-solved-if-statement-help/ Share on other sites More sharing options...
yukafluck Posted June 3, 2009 Author Share Posted June 3, 2009 nevermind, I'm a dumbass Link to comment https://forums.phpfreaks.com/topic/160834-solved-if-statement-help/#findComment-848829 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.