mochden
11-02-2007, 11:54 PM
hi there, im looking for help on how to get data out from a table, i did that part well, but now what i need is getting some of that info out not all, this table is where i store all the videos i add to our website, we put the videos into defferent categories, which is an other table in sql, so in this table that im pulling out the videos have a "catid" number from which category they belong. i need to pull out only the catid *44*#, and so far this is the code i have which pulls out all items in this table.
<? include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM jos_seyret_items";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b><center>What's Hot</center></b><br><br>";
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$title=mysql_result($result,$i,"title");
$itemcomment=mysql_result($result,$i,"itemcomment");
$picturelink=mysql_result($result,$i,"picturelink");
echo "<table border=0 cellpadding=5><tr><td><a href=http://www.webcastr.com/index.php?option=com_seyret&Itemid=27&task=videodirectlink&id=$id><img src=$picturelink border=0 width=80 height=65></a></td><td valign=top><font face=arial size=2><b><a href=http://www.webcastr.com/index.php?option=com_seyret&Itemid=27&task=videodirectlink&id=$id>$title</a></b></font><br><font face=arial size=0>$itemcomment</font></td></tr></table>";
$i++;
}
?>
any help will be awesome thx :P
<? include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM jos_seyret_items";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b><center>What's Hot</center></b><br><br>";
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$title=mysql_result($result,$i,"title");
$itemcomment=mysql_result($result,$i,"itemcomment");
$picturelink=mysql_result($result,$i,"picturelink");
echo "<table border=0 cellpadding=5><tr><td><a href=http://www.webcastr.com/index.php?option=com_seyret&Itemid=27&task=videodirectlink&id=$id><img src=$picturelink border=0 width=80 height=65></a></td><td valign=top><font face=arial size=2><b><a href=http://www.webcastr.com/index.php?option=com_seyret&Itemid=27&task=videodirectlink&id=$id>$title</a></b></font><br><font face=arial size=0>$itemcomment</font></td></tr></table>";
$i++;
}
?>
any help will be awesome thx :P