if($con = mysqli_connect("localhost", "root", $pass)) { mysqli_select_db($con, "toggery"); mysqli_set_charset($con, "utf8"); $p = $con->query("CALL Select_State()"); echo"<select name='sel1'>"; while($row = mysqli_fetch_array($p, MYSQLI_ASSOC)) { echo"<option value='$row[StateID]'>$row[Name]</option>"; } echo"</select>"; if(isset($_POST['sbm'])) { echo $s = $_POST['sel1']; } } else { echo 'db error!'; }
if($con = mysqli_connect("localhost", "root", $pass)) { mysqli_select_db($con, "toggery"); mysqli_set_charset($con, "utf8"); $p = $con->prepare("CALL Select_State()"); $p->execute(); echo"<select name='sel1'>"; while($row = mysqli_fetch_array($p, MYSQLI_ASSOC)) { echo"<option value='$row[StateID]'>$row[Name]</option>"; } echo"</select>"; if(isset($_POST['sbm'])) { echo $s = $_POST['sel1']; } } else { echo 'db error!'; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)