
نوشته اصلی توسط
<?php?>
حالا این روش union که دوستان گفتند چطور باید ازش استفاده کرد ؟
نمونه کدی برای استفاده ازش هست؟
ممنون از دوستان بابت پاسخاتون
کد:
<?php
if(isset($_GET['id']) && !empty($_GET['id'])){
$id=(int) $_GET['id'];
$result2=$config->connect->prepare("Select id From db_user_user Where id=? Union Select id From db_user_author Where id=? Union Select id From db_user_admin Where id=?");
$result2->bindValue(1,$id);
$result2->bindValue(2,$id);
$result2->bindValue(3,$id);
if($result2->execute()){
$count=array();
$count=$result2->rowCount();
echo $count;
if($count===1){
$rows=$result2->fetch(PDO::FETCH_ASSOC);
$user_edit->edit();
}
else{
echo 'ss';
}
}
else{
header('location: user-user.php');
exit();
}
}
else{
header('location: user-user.php');
exit();
}