-1
私の問題カウントはSQLです。mysqli_real_escape_string with mysqli_num_rows in PHP
<input name='d_n[]'>
<input name='d_n[]'>
PHPページ
ポスト値アダムの
foreach($ds_director as $key => $director){
// my problem here //
$DnumSql = "SELECT * FROM list WHERE ds_name = ?";
$stmt = $con -> prepare($DnumSql);
$stmt -> bind_param('s',$director);
$stmt -> execute();
$Dnum = $stmt->num_rows;
echo "$Dnum"; // result again '0'
/////////////
if($Dnum == 0){
$director_sql = mysqli_real_escape_string($con,ucwords($director));
$Dsql = "INSERT INTO movie_ds (ds_m_name, ds_name, ds_status) VALUES ('$director_sql', '$m_name', 'yönetmen')";
$Dquery = mysqli_query($con,$Dsql);
if($Dquery){
echo "<p style='color:green'>good</p>";
}else{
echo mysqli_error($con);
}
}else{
echo "<p style='color:red;'>not save</p>";
}
}
同じ値がeditted
のUPDATE PROBLEM =配列入力
ベター使用救われたのは真実=アダム。 – Saty
私のテーブルの[bind_param](http://php.net/manual/en/mysqli-stmt.bind-param.php) – vulkan
準備文について学ぶ – Jens