Jump to content

option, select, hyperlink to SQL databse


jamesk

Recommended Posts

Hi,

 

I am trying to create a dropdown menu to navigate to a reference in my database via the id number the code i am using looks like this:

 

<form name="drop">
<select name="list"
OnChange="location.href=drop.list.options[selectedIndex].value">
<?php do { ?>
<option>
<a value="http://localhost/fckdatabase/test.php?pageNum_test=<?php echo $row_edit['id']; ?>&totalRows_test=44"><?php echo $row_edit['Name']; ?></a> 
  <?php } while ($row_edit = mysql_fetch_assoc($edit)); ?>
</select>

 

Am i doing something wrong because when i click on the link it will try and take me to the data stored in my "Name" field

 

for example the link in my browser looks like this:

 

http://localhost/private/New%20page

 

and i want it to look like this

 

http://localhost/private/test.php?pageNum_test=3&totalRows_test=44">

 

the bold 3 should the echo of the id field

 

any hints or better ways of doing this?

 

Thanks

Link to comment
Share on other sites

I've solved that problem however now i have this one:

 

I am trying to make links that are in relation to my database. I am try it make it so that one page shows a lists of links displaying the information in my "Name" field. 

 

I have a unique key set up so that each record is identifiable "id".

 

and I want to display my record "data"

 

Any help would be super

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.