violinrocker Posted June 1, 2010 Share Posted June 1, 2010 I always get an error with this code... <?php $query="SELECT * FROM videos INNER JOIN alist ON videos.title=alist.title WHERE alist.title='$_GET[title]'"; $row = mysql_fetch_array($query)) { $title = str_replace( " ", "-", $row[title]); $eno = str_replace( " ", "-", $row[eno]); $title = str_replace( ".", "", $row[title]); $eno = str_replace( ".", "", $row[eno]); echo "if ($row['thumb'] == "") { while($r = mysql_fetch_array($result)) { echo "$r[lthumb]"; if ($r[lthumb] == "") { echo "http://www.janime.tv/banner.gif"; } else { echo "{$row[thumb]}"; }}"; } ?> what im trying to do is if the thumb from videos is empty, i will get the specified thumb from alist, and if there is no thumb in alist i will set the default 'no_image' link Quote Link to comment https://forums.phpfreaks.com/topic/203493-mysql_fetch_array/ Share on other sites More sharing options...
shadiadiph Posted June 1, 2010 Share Posted June 1, 2010 not quite sure what you are trying to achieve here your code is really confusing to look at sorry but i hope this gives you some ideas. if(isset($_GET['title'])){ $title = $_GET['title']; $query="SELECT * FROM videos INNER JOIN alist ON videos.title=alist.title WHERE alist.title='$title'"; $rquery=mysql_query($query); while($row=mysql_fetch_assoc($rquery)){ $title=$row['title']; $thumb=$row['thumb']; if ($thumb==false){ echo '<img src=\"link.php/imagefolder/nolink.gif\">'; } //-----END if ($thumb==false) if ($thumb==true){ echo '<img src=\"link.php/imagefolder/'.$thumb.'\">'; } //-----END if ($thumb==true) } //-----END while($row=mysql_fetch_assoc($rquery)) }//-----END if(isset($_GET['title'])) Quote Link to comment https://forums.phpfreaks.com/topic/203493-mysql_fetch_array/#findComment-1066041 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.