hi
im using combobox and retriving values in it from database , now what i wan is to get the selected value of combobox and send it in my php function....im unable to do this
need your help

thanx

hi
im using combobox and retriving values in it from database , now what i wan is to get the selected value of combobox and send it in my php function....im unable to do this
need your help

thanx

show your code.

Member Avatar for deleted1234

For you to achieve this you have to add another option to your combo box.

For example:

$sql = 'YOUR QUERY HERE';
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)){
          echo "<select>";
          echo "<option value='$row[item]'>$row[item]</option></select>\n";
}

if u want to get a specific value from mysql database u can use mysql_result();

$this = mysql_query("SELECT columname FROM tablename WHERE anycolumname = '$variable'");
$columnnamevalue = mysql_result($this, 0);

the 0 gets the first result i think if there are more than one result than 2 will get the third result.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.