<BODY>
<?
include("dbconnect.php");
$query = "select s_name from tbl_skill order by s_name";
echo "$query<br>";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
for ($index=0; $index <$num_results; $index++)
{
echo "$index<br>";
}
echo"$index blabla";
?>
</BODY>
This seems to me to be very simple code, but when I run it (http://www.verlynia.com/school/skill_list.php) all I get is the stuff from outside of the for loop. Originally it looked like this:
<BODY>
<?
include("dbconnect.php");
$query = "select s_name from tbl_skill order by s_name";
echo "$query<br>";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
for ($index=0; $index <$num_results; $index++)
{
$row = mysql_fetch_array($result);
echo "$row[\"s_name\")<br>";
}
echo"$index blabla";
?>
</BODY>
But that wasn't working either. I provide this code simply so that you can see what the final goal is- I want to print out a list of every s_name within tbl_skill. If there's a better way to do it than by using mysql_fetch_array, et all, I'd appreciate it if you could suggest it.
Thanks.