Jump to content

[solved] Warning: mysql_fetch_array() expects parameter 1 to be resource, string given in photos.php on line 100


lambik

Recommended Posts

Hi guys, once again I am unable to solve my problems so I post them here. Here is my code which shows photoalbums and it is a little bit complicated because it is checking if there exist album with given number $pocet then it also checks if there is cover photo, if not it will show up original photo from folder images. But I get this error message and I can't solve it and what's more interesting is that my page is all good just as I want it except this error. Hmmm.

echo("<div class=\"article\">");		if ($albums>0)		{			echo("			<h2>Albumy používateľa <a href=\"user_profile.php?meno=".$_REQUEST['meno']."\">".$_REQUEST['meno']."</a></h2>			");						while ($pocet<$albumy+1)			{				$albumid=$pocet-1;				$profil='nie';

$album=mysql_query("SELECT * FROM fotky WHERE meno='".$_REQUEST['meno']."' && albumid='".$pocet."' ") or exit(mysql_error()); while ($riadok=mysql_fetch_array($album))

				{					if ($riadok['profilova']=='ano')					{					$profil='ano';					$album=$riadok['album'];					$last=$riadok['last'];					$ext=$riadok['ext'];					}					$albumid=$riadok['albumid'];				}								if ($albumid==$pocet)				{					if ($profil=='ano')					{				echo("				<a href=\"view_album.php?meno=".$_REQUEST['meno']."&albumid=".$pocet."\">				<img src=\"users/".$_REQUEST['meno']."/".$pocet."/".$last.".".$ext."\" height=\"165\" width=\"165\" alt=\"\" style=\"margin:0px 15px 15px 0px;\" title=\"Album ".$album."\"/>				</a>				");					}				else						{				echo("				<a href=\"view_album.php?meno=".$_REQUEST['meno']."&albumid=".$pocet."\">				<img src=\"images/userpic.gif\" height=\"165\" width=\"165\" alt=\"\" title=\"Tento album nemá nastavený obal\" style=\"margin:0px 15px 15px 0px;\"/>				</a>				");						}				}				$pocet=$pocet+1;			}					}		else		{			if ($_REQUEST['meno']==$_SESSION['user'])			{			echo("			<h2>Zatiaľ nemáte žiadny fotoalbum!</h2>			<h3>Vytvorte si ho pomocou tlačidla výše.</h3>");				}			else{			echo("			<h2>To je škoda!</h2>			<h3>Radi by sme vám ukázali nejaké nahotinky tohto užívateľa alebo aspoň jeho fotky o zrkadlo, ale bohužiaľ si ešte nevytvoril žiadny album.</h3>");}		}		echo("</div>");		  }

The selected part is what's giving me error.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...