lambik Posted April 16, 2011 Share Posted April 16, 2011 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 More sharing options...
justsomeguy Posted April 16, 2011 Share Posted April 16, 2011 You should be checking for errors from mysql:mysql_query(...) or exit(mysql_error()); Link to comment Share on other sites More sharing options...
lambik Posted April 16, 2011 Author Share Posted April 16, 2011 Check my code now I have edited it as you suggested. Still the same result though. Link to comment Share on other sites More sharing options...
justsomeguy Posted April 16, 2011 Share Posted April 16, 2011 You're using the name $album twice, you need to change one of them. Link to comment Share on other sites More sharing options...
lambik Posted April 17, 2011 Author Share Posted April 17, 2011 Oh boy i am so stupid...maybe result of late night work. thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.