Jump to content

mysql_fetch_array


violinrocker

Recommended Posts

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

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

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']))

Link to comment
https://forums.phpfreaks.com/topic/203493-mysql_fetch_array/#findComment-1066041
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.