0

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/fellowes/public_html/createaccount.php on line 108

include("conf.inc.php");
	$tbl_name="tbl_courses";
	
	$sql=mysql_query("SELECT * FROM $tbl_name WHERE crs_semister=1 AND crs_period='A'") or die(mysql_error());
	$result=mysql_num_rows($sql);
<?php while($rows=mysql_fetch_array($result)) { ?>
                        <option><?php echo $rows['crs_code']; ?>//Line 108</option>
                    <?php } ?>
2
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by ryan_vietnow
1

Replace the $result in this one:

<?php while($rows=mysql_fetch_array($result)) { ?>
                        <option><?php echo $rows['crs_code']; ?>//Line 108</option>
                    <?php } ?>

to $sql because your $sql variable is what holds your query.
$result holds the mysql_num_rows value.

Votes + Comments
Made me realize a stupid mistake
0

When I change it nothing appears... And there are two fields in the table...

0

Sorry... I haven't slepped well for the past couple days... School just started so I have been making stupid mistakes I shouldn't be making... Your right... I just realized what I did wrong. Thanks again

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.