put sql data into dropdown, and when submit pull up row depending on primary id

I am new to php and
i need some help, i need to put data from a mySQL table into a dropdown which I have got pretty much, but I am lost as how to pull up the row depending on what is selected in the dropdown

here is what I have so far:

<?php session_start(); $db_host = '**'; $db_user = '****'; $db_pwd = '***'; $database = '****'; $table = 'Card'; if (!mysql_connect($db_host, $db_user, $db_pwd)) die("Can't connect to database"); if (!mysql_select_db($database)) die("Can't select database"); $id = $_SESSION['userID']; $run = "SELECT cardid FROM Card"; // need to put in WHERE userid=userid session variable $test = mysql_query($run) or die('Error: ' .mysql_error()); // extract($rowSC); echo ""; while( $rowSC = mysql_fetch_array($test) ){ echo "method = 'post'"; echo "" . $test['cardid'] . ""; } echo $test['cardid']; $_post['cardchoice'] = $apple; echo ""; echo $test['cardid']; echo "" ?>


very scrambled and all over the placeā€¦ as you can see im pretty lost

Sponsor our Newsletter | Privacy Policy | Terms of Service