Categories > TinyButStrong general >

Problem With Radio

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Zinan
Date: 2006-04-03
Time: 13:47

Problem With Radio

Hi..

I need help about radio buttons..
Here is an example from my code:

I tried to make a data array on a survey.
HTML Side:
------------------
<table><tr><td>
[var.sel1_name;selected=radio1]
</td></tr></table>

PHP Side:
------------------
$anketcevaplar = mysql_query("SELECT options FROM survey");


But I couldn't make an array and take my options from my database..
Please help me how I can do it..
By: Skrol29
Date: 2006-04-03
Time: 17:19

Re: Problem With Radio

Hello Zinan,

You need to have selected items stored into an Array in order to have them   processed by parameter " selected".
So you juste have to run the query and save each value of rows into an array.
Like this :
$anketcevaplar = mysql_query("SELECT options FROM survey");
$sell = array();
while (record = mysql_fetch_array($anketcevaplar)) {
  $sell[] = record['options'];
}