I want to do a trap that if the array has a value the same within the database. they will then proceeded to the if condition I build. So far this is my code.
$a = $_POST['a'];
$b = $_POST['b'];
foreach ($_POST['b'] as $b)
{
$result = mysql_query("select * from ehr_schedule3 where (sched3_time='$b' and sched2_id='$a') ");
$row = mysql_fetch_array($result);
$num = mysql_num_rows($result);
}
if(strpos($b, $result)==true) //$b is the array value I will insert to the db.
{
header("Location: ../edit_sched2.php?asdfghjkl=".$a."?false");
$_SESSION["A"] = "E" ;
}
I don't know how to play with array in the mysql_query. I just want to proceed it to if
if there is just one of the same value. I originally planning to make it a string so that if the strpos
have confirmed it has the same value, it will proceed then to the if