Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

"expects parameter 1 to be resource"

$
0
0

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\Muratcea_S_3014_hw5\index.php on line 101

Call Stack

#

Time

Memory

Function

Location

1

0.0003

149672

{main}( )

..\index.php:0

2

0.0031

157128

mysql_fetch_array ( )

..\index.php:101

 

( ! ) Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\Muratcea_S_3014_hw5\index.php on line 149

Call Stack

#

Time

Memory

Function

Location

1

0.0006

150632

{main}( )

..\index.php:0

2

0.0048

158232

mysql_num_rows ( )

..\index.php:149

Im not sure what to include here so I will show those specific areas...

 

<?php
		$con=0;
		while($row = mysql_fetch_array($movResults)){	
			if($con == 0) {
			echo "<div class=\"container\">
			<div class=\"row\">
			<div class=\"fourcol\">
				<div class=\"movImg\">
					<img src=\"images/".$row['products_thumb']."\" alt=\"".$row['products_name']."\">
			</div>
        	<div class=\"movTxt\">
            	<h3>".$row['products_name']."</h3>
            	<p>".$row['products_price']."</p>
								<a href=\"productdetail.php?id=".$row['products_id']."\">View Product.....</a>

        	</div>
        </div>";
		$con++;
			}else if($con == 1){
			echo "<div class=\"fourcol\">
				<div class=\"movImg\">
					<img src=\"images/".$row['products_thumb']."\" alt=\"".$row['products_name']."\">
			</div>
        	<div class=\"movTxt\">
            	<h3>".$row['products_name']."</h3>
            	<p>".$row['products_price']."</p>
								<a href=\"productdetail.php?id=".$row['products_id']."\">View Product.....</a>

        	</div>
        </div>";
		$con++;
			}else if($con == 2){
			echo"<div class=\"fourcol last\">	
			<div class=\"movImg\">
					<img src=\"images/".$row['products_thumb']."\" alt=\"".$row['products_name']."\">
			</div>
        	<div class=\"movTxt\">
            	<h3>".$row['products_name']."</h3>
            	<p>".$row['products_price']."</p>
								<a href=\"productdetail.php?id=".$row['products_id']."\">View Product.....</a>

        	</div>
        	</div>
			</div>
		</div>
		<div class=\"row\">";
		$con = 0;
			}
		}
		
		$numRows = mysql_num_rows($movResults);
		$div = $numRows%3; 
	
		if($div==1){
			echo"<div class=\"eightcol last\"></div></div></div>";
		}else if($div==2){
			echo"<div class=\"fourcol last\"></div></div></div>";
		}
	
		?>

 

 

I really dont understand whats happening. I'm new to this 


Viewing all articles
Browse latest Browse all 13200

Trending Articles