Jump to content

Changing the Value of a drop down box.


brent123456

Recommended Posts

When posting the form check to see if the value of the selection is one of the valid ones.

 

So if you're using a SQL query:

 

$sel = $_POST['sel'];

if($sel){
$sql = "SELECT * FROM `table` WHERE `this`='$sel'";
$res = mysql_query($sql) or die(mysql_error());
   if(mysql_num_rows($res) == 0){
   echo "Doesn't exist";
   }else {
   echo "Exists";
   }
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.