0

I looked everywhere and tried everything to get the selected mySQL value from a sQL queries radion button.

here is my code

<?php
    while($p1Result = mysql_fetch_array($p1Query))
    {?>
      <input type="radio" id="txtShop" name="txtShop" value="<?php $p1Result['buy_code'];?>"> <?php echo $p1Result['buy_code']. "  " .$p1Result['buy_name']; ?><br>
<?php
}
?>

Thanks

akenaza
  • 9
  • 3
  • 2
    Please elaborate on the issue you are facing. – ck_arjun Mar 16 '16 at 04:38
  • you want to set selected value from sql query of your radio button ? is that it ? – Amit Chauhan Mar 16 '16 at 04:48
  • @ck_arjun i want to get value same as echo the radio button Like i have 100 records and i want to show 100 records by use radio button to let user select, then i want to get value same as record that user select Example: **Bold text is a value that i need** _italic is value that i shown_ "> __ Thanks ck_arjun – akenaza Mar 16 '16 at 04:49

1 Answers1

2

In Your code echo is missing in the value

<?php
    while($p1Result = mysql_fetch_array($p1Query))
    {?>
      <input type="radio" id="txtShop" name="txtShop" value="<?php echo $p1Result['buy_code'];?>"> <?php echo $p1Result['buy_code']. "  " .$p1Result['buy_name']; ?><br>
    <?php
    }
    ?>
Dass Prakash
  • 152
  • 2
  • 13