View Full Version : Outputting data from a mySQL table

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_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM jos_seyret_items";



echo "<b><center>What's Hot</center></b><br><br>";

while ($i < $num) {


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>";



any help will be awesome thx :P

11-03-2007, 12:16 AM
SELECT * FROM table WHERE catid = 'whatever'

11-03-2007, 12:23 AM
awesome, thanks a lot for the help.

11-03-2007, 12:31 AM
I would recommend on reading up on MySQL LIMIT since that is where I see this heading :)