Jump to content

HELP!?


pacitto513

Recommended Posts

Hey everyone,

 

I have this php code below and for some reason I keep getting the following error message when my page is loaded: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Website-v1.0\root\home.php on line 47

 

Iv tried changing a few things within my code but nothing seems to work. Any ideas on how to fix this bug?

 

<?php
$post_user_pic= '';
$postDisplayList = '';
$deletepost= '';
$sql_posts_data = mysql_query("SELECT postid, member_id, location, post_body, post_date, replies FROM posts ORDER BY post_date DESC LIMIT 10");
while($row = mysql_fetch_array($sql_posts_data)){
$postid = $row["postid"];
$postuserid = $row["member_id"];
$post_body= $row["post_body"];
$location = $row["location"];
$postreplies = $row["replies"];
$post_date = $row["post_date"];
$post_date = strftime("%b %d, %Y at %I:%M %p", strtotime($post_date));

$sql_postmem_data = mysql_query("SELECT id, username, fullname FROM members WHERE id='$postuserid' LIMIT 1");
while($row = mysql_fetch_array($sql_postmem_data)){
		$postmemberid = $row["id"];
		$postusername = $row["username"];
		$postfullname = $row["fullname"];
		$post_user_check_pic = "members/$postmemberid/image01.jpg";
		$post_user_default_pic = "members/0/defaultpic.jpg";
		if (file_exists($post_user_check_pic)) {
		$post_user_pic = "<img src=\"$post_user_check_pic\" width=\"50px\" height=\"50px\" ?BORDER=\"0\" border=\"0\" />"; 
		} else {
		$post_user_pic = "<img src=\"$post_user_default_pic\" width=\"50px\" height=\"50px\" ?BORDER=\"0\" border=\"0\" />";
		}

	if (isset($_SESSION['id'])) {
		if($_SESSION['id']==$uid){

			$postDisplayList .= '';
	} else

		$postDisplayList .= '';
	}
}				
}
?>

Link to comment
https://forums.phpfreaks.com/topic/263010-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.