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 06-24-2007, 03:31 PM   #1
Superior
 
Join Date: Jun 2007
Posts: 6
Default second option wont submit on dropdowns

Hi friends,

I have watched this vidieo and installed the script without a problem but what I am running into is the second field wont submit calling the products that are related.am I missing something? you can see it on my testing server http://www.superiorkustoms.com/testing it is located just under the header.Any help is greatfully apreciated
Superior is offline   Reply With Quote
Old 06-24-2007, 04:11 PM   #2
Mark_W
 
Join Date: May 2007
Location: South London
Posts: 136
Default

You have an error on line 147 of your coding. Looking at the source code just below the drop down values you can see that.
Mark_W is offline   Reply With Quote
Old 06-24-2007, 04:16 PM   #3
Superior
 
Join Date: Jun 2007
Posts: 6
Default

Hi thx for the qwick reply this is line 147
<?php }while ($rowModel = mysql_fetch_array($result)); ?> in tht case I will post my whole code in the next post
Superior is offline   Reply With Quote
Old 06-24-2007, 04:17 PM   #4
Superior
 
Join Date: Jun 2007
Posts: 6
Default

PHP Code:
<?php 
require_once("Connections/connection.php"); // database connection
$make $_POST['make'];
 
if (
$make){
/////////////////////////////////////////////////
$query sprintf("SELECT * FROM products_description where car_model_id='$make'");
$result = @mysql_query($query); 
$rowModel mysql_fetch_array($result);
/////////////////////////////////////////////////
}
?>
PHP Code:
<center><form id="form1" name="form1" method="post" action="<?php $_SERVER['PHP_SELF']; ?>">
<select name="make" onChange="document.forms[0].submit()">
<option value="">Select Make</option>
<option value="1"<?php if(!(strcmp(1$make))){echo "selected";}?>>Acura</option>
<option value="57"<?php if(!(strcmp(57$make))){echo "selected";}?>>Alfa</option>
<option value="2"<?php if(!(strcmp(2$make))){echo "selected";}?>>Audi</option>
<option value="3"<?php if(!(strcmp(3$make))){echo "selected";}?>>BMW</option>
<option value="28"<?php if(!(strcmp(28$make))){echo "selected";}?>>Buick</option>
<option value="37"<?php if(!(strcmp(37$make))){echo "selected";}?>>Buick</option>
<option value="29"<?php if(!(strcmp(29$make))){echo "selected";}?>>Cadillac</option>
<option value="4"<?php if(!(strcmp(4$make))){echo "selected";}?>>Chevrolet</option>
<option value="24"<?php if(!(strcmp(24$make))){echo "selected";}?>>Chrysler</option>
<option value="39"<?php if(!(strcmp(39$make))){echo "selected";}?>>Daewoo</option>
<option value="46"<?php if(!(strcmp(46$make))){echo "selected";}?>>DeTomaso</option>
<option value="5"<?php if(!(strcmp(5$make))){echo "selected";}?>>Dodge</option>
<option value="25"<?php if(!(strcmp(25$make))){echo "selected";}?>>Eagle</option>
<option value="56"<?php if(!(strcmp(56$make))){echo "selected";}?>>Ferrari</option>
<option value="47"<?php if(!(strcmp(47$make))){echo "selected";}?>>Fiat</option>
<option value="6"<?php if(!(strcmp(6$make))){echo "selected";}?>>Ford</option>
<option value="38"<?php if(!(strcmp(38$make))){echo "selected";}?>>Geo</option>
<option value="23"<?php if(!(strcmp(23$make))){echo "selected";}?>>GMC</option>
<option value="7"<?php if(!(strcmp(7$make))){echo "selected";}?>>Honda</option>
<option value="42"<?php if(!(strcmp(42$make))){echo "selected";}?>>Hummer</option>
<option value="20"<?php if(!(strcmp(20$make))){echo "selected";}?>>Hyundai</option>
<option value="8"<?php if(!(strcmp(8$make))){echo "selected";}?>>Infiniti</option>
<option value="34"<?php if(!(strcmp(34$make))){echo "selected";}?>>Isuzu</option>
<option value="41"<?php if(!(strcmp(41$make))){echo "selected";}?>>Jaguar</option>
<option value="21"<?php if(!(strcmp(21$make))){echo "selected";}?>>Jeep</option>
<option value="40"<?php if(!(strcmp(40$make))){echo "selected";}?>>Kia</option>
<option value="43"<?php if(!(strcmp(43$make))){echo "selected";}?>>Lamborgini</option>
<option value="35"<?php if(!(strcmp(35$make))){echo "selected";}?>>Land Rover</option>
<option value="10"<?php if(!(strcmp(10$make))){echo "selected";}?>>Lexus</option>
<option value="30"<?php if(!(strcmp(30$make))){echo "selected";}?>>Lincoln</option>
<option value="48"<?php if(!(strcmp(48$make))){echo "selected";}?>>Lotus</option>
<option value="11"<?php if(!(strcmp(11$make))){echo "selected";}?>>Mazda</option>
<option value="12"<?php if(!(strcmp(12$make))){echo "selected";}?>>Mercedes</option>
<option value="31"<?php if(!(strcmp(31$make))){echo "selected";}?>>Mercury</option>
<option value="36"<?php if(!(strcmp(36$make))){echo "selected";}?>>MINI</option>
<option value="13"<?php if(!(strcmp(13$make))){echo "selected";}?>>Mitsubishi</option>
<option value="14"<?php if(!(strcmp(14$make))){echo "selected";}?>>Nissan</option>
<option value="28"<?php if(!(strcmp(28$make))){echo "selected";}?>>Oldsmobile</option>
<option value="49"<?php if(!(strcmp(49$make))){echo "selected";}?>>Opel</option>
<option value="50"<?php if(!(strcmp(50$make))){echo "selected";}?>>Peugeot</option>
<option value="32"<?php if(!(strcmp(32$make))){echo "selected";}?>>Plymouth</option>
<option value="22"<?php if(!(strcmp(22$make))){echo "selected";}?>>Pontiac</option>
<option value="15"<?php if(!(strcmp(15$make))){echo "selected";}?>>Porsche</option>
<option value="51"<?php if(!(strcmp(51$make))){echo "selected";}?>>Proton</option>
<option value="52"<?php if(!(strcmp(52$make))){echo "selected";}?>>Ranault</option>
<option value="37"<?php if(!(strcmp(37$make))){echo "selected";}?>>Reatta</option>
<option value="27"<?php if(!(strcmp(27$make))){echo "selected";}?>>Saab</option>
<option value="26"<?php if(!(strcmp(26$make))){echo "selected";}?>>Saturn</option>
<option value="44"<?php if(!(strcmp(44$make))){echo "selected";}?>>Scion</option>
<option value="53"<?php if(!(strcmp(53$make))){echo "selected";}?>>Seat</option>
<option value="54"<?php if(!(strcmp(54$make))){echo "selected";}?>>Skoda</option>
<option value="16"<?php if(!(strcmp(16$make))){echo "selected";}?>>Subaru</option>
<option value="19"<?php if(!(strcmp(19$make))){echo "selected";}?>>Suzuki</option>
<option value="17"<?php if(!(strcmp(17$make))){echo "selected";}?>>Toyota</option>
<option value="55"<?php if(!(strcmp(55$make))){echo "selected";}?>>Vauxhall</option>
<option value="9"<?php if(!(strcmp(9$make))){echo "selected";}?>>Volkswagen</option>
<option value="18"<?php if(!(strcmp(18$make))){echo "selected";}?>>Volvo</option>
 
</select> 
<form id="form1" name="form1" method="get" action="<?php $_SERVER['PHP_SELF']; ?>">
<select name="model_id"onChange="document.forms[0].submit()">
<option value="">Select Model</option>
<?php do { ?>
<option value="<?php echo $rowModel['car_model_id']; ?>"><?php echo $rowModel['car_model']; ?></option>
<?php }while ($rowModel mysql_fetch_array($result)); ?>
</select>
 
</form>
Superior is offline   Reply With Quote
Old 06-24-2007, 04:27 PM   #5
Superior
 
Join Date: Jun 2007
Posts: 6
Default

This is line 147 <?php }while ($rowModel = mysql_fetch_array($result)); ?>
Superior is offline   Reply With Quote
Old 06-24-2007, 04:28 PM   #6
Superior
 
Join Date: Jun 2007
Posts: 6
Default

sorry for the double post I could not see it so I thought is was not here
Superior is offline   Reply With Quote
Old 06-24-2007, 05:29 PM   #7
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

Mmm ... you have named both forms the same although i dont think this is the problem.
so are you saying that the first dropdown doesnt populate the second onchange?
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 06-24-2007, 07:39 PM   #8
Superior
 
Join Date: Jun 2007
Posts: 6
Default

the first(Make) dropdown does populate the second(model)dropdown but after the model is diplayed and you select it it does not display the results as it should
Superior is offline   Reply With Quote
Old 06-24-2007, 10:25 PM   #9
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

Quote:
Originally Posted by Superior View Post
you can see it on my testing server http://www.superiorkustoms.com/testing
Quote:
Originally Posted by Mark_W View Post
You have an error on line 147 of your coding. Looking at the source code just below the drop down values you can see that.
Quote:
Originally Posted by Superior View Post
Hi thx for the qwick reply this is line 147
<?php }while ($rowModel = mysql_fetch_array($result)); ?> in tht case I will post my whole code in the next post
Mark was talking about the HTML page , we cannot see the php page.
Look at the page you have on the web and try to validate it, and you'll see the errors as well.
domedia is offline   Reply With Quote
Old 06-24-2007, 10:56 PM   #10
Superior
 
Join Date: Jun 2007
Posts: 6
Default

This is what the source code says
<b>Warning</b>: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in <b>/testing/templates/Original_B2B/header.php</b> on line <b>148</b><br />

Still not sure what it means but overall the the code is working till I get to the last step of submitting and displaying
Superior 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 01:52 PM.


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