A newbie's question on Turotial dd3.zip

I am new to both php and mySQL. I just installed the WAMP and have tested the functions. They are working. Also, the database "dd3" has been created in mySQL. However, using the dd3.zip file, I came across following mess:

address shown in my IE: http://localhost/dd3/dd3.php

Can you tell me what's wrong with my settings or something else. Thanks.

0){ $quer=mysql_query("SELECT DISTINCT subcategory,subcat_id FROM subcategory where cat_id=$cat order by subcategory"); }else{$quer=mysql_query("SELECT DISTINCT subcategory,subcat_id FROM subcategory order by subcategory"); } ////////// end of query for second subcategory drop down list box /////////////////////////// /////// for Third drop down list we will check if sub category is selected else we will display all the subcategory3///// $cat3=$_GET['cat3']; // This line is added to take care if your global variable is off if(isset($cat3) and strlen($cat3) > 0){ $quer3=mysql_query("SELECT DISTINCT subcat2 FROM subcategory2 where subcat_id=$cat3 order by subcat2"); }else{$quer3=mysql_query("SELECT DISTINCT subcat2 FROM subcategory2 order by subcat2"); } ////////// end of query for third subcategory drop down list box /////////////////////////// echo "
"; ////////// Starting of first drop downlist ///////// echo "Select one"; while($noticia2 = mysql_fetch_array($quer2)) { if($noticia2['cat_id']==@$cat){echo "$noticia2[category]"."";} else{echo "$noticia2[category]";} } echo ""; ////////////////// This will end the first drop down list /////////// ////////// Starting of second drop downlist ///////// echo "Select one"; while($noticia = mysql_fetch_array($quer)) { if($noticia['subcat_id']==@$cat3){echo "$noticia[subcategory]"."";} else{echo "$noticia[subcategory]";} } echo ""; ////////////////// This will end the second drop down list /////////// ////////// Starting of third drop downlist ///////// echo "Select one"; while($noticia = mysql_fetch_array($quer3)) { echo "$noticia[subcat2]"; } echo ""; ////////////////// This will end the third drop down list /////////// echo "
"; ?>
It seems your PHP code is not executing. Start with phpinfo
Thanks for your reply. But my PHP is working. I tried using it to connect with database and validate username and pwd for a login application. It has no problem.

The dd3 case, it seems working partially - I see the dropdown boxes but they do not show correctly. Thanks.

I installed wamp.
PHP part of the code should not reach web browser. So you might have missed the starting tag <?PHP inside your code. Check this thread also
You are missing the 'php' portion on one of your question marks. The begin php should be like <?php. Your interpreter does not understand just the <?.
Have fun.
Exactly as you said. Thank you all very much...
Please Login to post your reply or start a new topic