ขออนุญาตสอบถามครับ ผมมือใหม่
โพสต์แล้ว: 17/10/2018 11:24 am
ขออนุญาตสอบถาม ผมมือใหม่หัดเขียนครับ แล้วเจอปัยหาแบบตามนี้ครับ
Notice: Undefined variable: photo_post in C:\xampp\htdocs\hrd\comm_page.php on line 38
if(isset($_REQUEST['method'])=='check_comm'){
$comm_id=$_REQUEST['comm_id'];
$sql_comm= mysqli_query($db, "update comment set check_comm='R' where comm_id='$comm_id'");
}
$sql = "select tp.*,CONCAT(em.firstname,' ',em.lastname) as fullname,em.photo as photo from topic_post tp
inner join emppersonal em on em.empno=tp.empno_post
where topic_id='$topic_id'";
$qr=mysqli_query($db,$sql);
$topic_post = mysqli_fetch_assoc($qr);
if (!empty($topic_post['photo'])) {
$photo = $topic_post['photo'];
$folder = "photo/";
} else {
$photo = 'person.png';
$folder = "images/";
}
if (!empty($topic_post['photo_post'])) {
$photo_post = $topic_post['photo_post'];
$folder_post = "post/";
} else {
}
$file_name = $photo_post ;
$info = pathinfo( $file_name , PATHINFO_EXTENSION ) ;
if($info=='pdf' or $info=='PDF'){
$width='400';
$hight='400';
}else{
$width='20%';
$hight='';
}
ไม่ทราบว่าผมผิดตรงไหน ต้องแก้ไขยังไงครับ ขอบพระคุณครับ
Notice: Undefined variable: photo_post in C:\xampp\htdocs\hrd\comm_page.php on line 38
if(isset($_REQUEST['method'])=='check_comm'){
$comm_id=$_REQUEST['comm_id'];
$sql_comm= mysqli_query($db, "update comment set check_comm='R' where comm_id='$comm_id'");
}
$sql = "select tp.*,CONCAT(em.firstname,' ',em.lastname) as fullname,em.photo as photo from topic_post tp
inner join emppersonal em on em.empno=tp.empno_post
where topic_id='$topic_id'";
$qr=mysqli_query($db,$sql);
$topic_post = mysqli_fetch_assoc($qr);
if (!empty($topic_post['photo'])) {
$photo = $topic_post['photo'];
$folder = "photo/";
} else {
$photo = 'person.png';
$folder = "images/";
}
if (!empty($topic_post['photo_post'])) {
$photo_post = $topic_post['photo_post'];
$folder_post = "post/";
} else {
}
$file_name = $photo_post ;
$info = pathinfo( $file_name , PATHINFO_EXTENSION ) ;
if($info=='pdf' or $info=='PDF'){
$width='400';
$hight='400';
}else{
$width='20%';
$hight='';
}
ไม่ทราบว่าผมผิดตรงไหน ต้องแก้ไขยังไงครับ ขอบพระคุณครับ