Losing first line of results
Posted: Wed Mar 12, 2008 2:56 pm
I'm using the following code to display results from my database:
This should result in a list of names with the subject heading above. I get the subject heading and the list of names, but the first name in the list is also missing.
Why is this happening?
Thanks for any help or suggestions.
Bill
Code: Select all
$sql = "SELECT name, description, url, subject FROM tblname INNER JOIN tbllink ON tblname.nmid = tbllink.nmid INNER JOIN tblsubject ON tbllink.sbid = tblsubject.sbid WHERE tblsubject.sbid = $id ORDER BY name";
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
echo mysql_result($result,$i,'subject');
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<dt><a href={$row['url']} target='_new'>{$row['name']}</a></dt>" .
"<dd>{$row['description']}</dd>";
}Why is this happening?
Thanks for any help or suggestions.
Bill