YourAdrenalineFix Posted December 29, 2012 Share Posted December 29, 2012 Hi everyone, Recently I just read everything on w3Schools regarding HTML, CSS, JS and PHP (Including Ajax, XML etc Modules) but I'm still a longgggg ways to go on being fluent on any of it. It's just SOOOOO much to take in. Anyways... I've got a classifieds script on my site (something I purchased a couple years ago and have been "Tweaking it" best I know how since...) Well I'm wanting to make this sucker (the website) SUPER user friendly (which it's presently NOT) and I'm having trouble (a lot of trouble) just understanding why one part of a page will not display as well as I could go on all day about other things. In the attached file, add.php the section I cannot get to display looks like this: if(mysql_num_rows($result) > 0){ echo "<form action='add.php' autocomplete='on' method='get'>";echo "Please select subcategory of ";echo "<strong>".$category['Title']."</strong>";echo " to add ad: ";echo "<select name='fatherID'>";if( $subcat = mysql_fetch_assoc($result) ){echo "<option value='".$subcat['ID']."'>";echo $subcat['Title'];echo "</option>";}echo "</select>";echo '<input type="submit" value="Get Started Listing My Ad">';echo "</form>"; Here's How I'm "Thinking" this is suppossed to work: To ME, This looks like a <select></select> drop down that automatically populates with present categories. Cool... I've never seen this work on my site, I just found it in the code but regardless, It's what I need to do and it's very close to what I already had in mind. Sort of a Win Win there that just popped up. But... I dont know how to make it display so If anyone could kindly chime in and offer any input on how I can make this <select> drop down appear on the page I'd be most appreciative and I thank you in advance!! Stuart K Link to comment Share on other sites More sharing options...
satishpoul Posted January 2, 2013 Share Posted January 2, 2013 (edited) if( $subcat = mysql_fetch_assoc($result) ){ should be like this while($subcat = mysql_fetch_assoc($result)){ Edited January 2, 2013 by satishpoul Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now