Jump to content


Photo

Html , php problem :(


  • Please log in to reply
3 replies to this topic

#1 ChrisLeah

ChrisLeah
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 20 September 2006 - 07:42 PM

<? $sql_features = mysql_query("SELECT * FROM faq;");
while($feature = mysql_fetch_assoc($sql_features)); { ?>
<select name="faq">
<option value="0">Choose Feature</option>
<option value="<a href="http://www.gangstern...php#<?=$feature['id']?>"><?=$feature['heading']?></option>
</select>
<? } ?>


this code shows nothing but the first option, "Choose Feature". I have no idea why it will not show the rest. Please help? It sapart of a drop down menu, all the headings are in the DB. I want it so they can select from the list and it go to the anchored postition by clicking it.

please help?

thanks,
Chris

#2 sasa

sasa
  • Staff Alumni
  • Advanced Member
  • 2,804 posts
  • LocationHrvatska

Posted 20 September 2006 - 07:53 PM

in line
while($feature = mysql_fetch_assoc($sql_features)); { ?>
remove ;

#3 ChrisLeah

ChrisLeah
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 20 September 2006 - 07:58 PM

Thank you, but not I get all the options in seprate drop down lists. How can I do it so it shows all headings and links once clicked to teh correct anchor its automatically given once in DB?

thanks again.

#4 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 20 September 2006 - 11:17 PM

are you trying to get something like http://www.gangstern...q.php#something

try this

<option value="<a href="http://www.gangsternation.net/faq.php#<? echo $feature['id']; ?>"><? echo $feature['heading']; ?></option>

If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users