For some reason when I run my code, the:
echo $row["name"];
shows all but one row from my database. No matter how many records there are, one row of records from the database is always missing. Can anyone tell me why this is? See code below:
<?php
$host = "";
$uname="root";
$pass="";
$database="discuss";
$tablename="threads";
$connection = mysql_connect($host, $uname, $pass);
$result =mysql_select_db("discuss");
$query ="SELECT topic, thread_num, sub_num, new_thread, date_time, name from threads order by thread_num desc, sub_num asc";
$result = mysql_query($query);
$t_array = mysql_fetch_assoc($result);
?>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<form name="form1" method="post" action="discuss_submit.asp">
<div align="left">Press:
<input name="imageField" type="image" src="images/Submit.gif" width="55" height="14" border="0">
<input type="hidden" name="newpost" value="yes">
<input type="hidden" name="thread_num" value="
<?php $max_thread = array_slice ($t_array,2,1);
foreach ($max_thread as $th)
{
echo $th+1;
}
?>
">
<input type="hidden" name="sub_thread" value="0">
to start a new topic.
<?php
while ($row = mysql_fetch_assoc($result))
{
echo $row["name"];
echo "<br>";
}
?>
</form>