trying to redirect the php page is get id is empty ir does not exists.

Posted by user570782 on Stack Overflow See other posts from Stack Overflow or by user570782
Published on 2011-01-12T05:39:57Z Indexed on 2011/01/12 5:53 UTC
Read the original article Hit count: 169

Filed under:
|
<?
include.....
if ($picid != $_GET['picid']) || (empty($picid)) { echo "page not working";

}
else {
$picid = $_GET['picid'];
$query = mysql_query("SELECT * FROM pic_info WHERE picid = 'picid1' ");// problem

while($rows = mysql_fetch_assoc($query)):
$picid = $rows['picid'];
$title = $rows['title'];
$link = $rows['link'];
$description = $rows['description'];
$movie_pic = $rows['movie_pic'];
$source = $rows['source'];

}

$get_comment = mysql_query("SELECT * FROM comment WHERE picid ='$picid'");// work partially
$comment_count = mysql_num_rows($get_comment);
if ($comment_count>0)
{ messages = " ";
while ($com = mysql_fetch_array($get_comment)){
$comment_id = $com['comment_id'];
$name = $com['name'];
$message = $com['message'];
$time_post= $com['time_post'];
$messages .= '<em> on ' .$time_post.'</em><b>   '.$name.'   said.....</b><br/> '.$message.'<hr/>';  // line with problem
}
}
?>

i am stuck i am trying to say that if $_GET['picid']; is empty echo out error message or if the movid does not exist in the db echo out error message. when i run it i get an error. not sure if i am calling the correct function. what am i doing wrong please help

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql