hazm Posted February 26, 2013 Share Posted February 26, 2013 I face same problem but different program... <?php $c=$_REQUEST['course']; $link = mysql_connect('localhost', 'root', ''); //change the configuration in required if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db('subject'); print $c; ?> <select name="subject"> <option>Select Subject</option> <?php $kus= mysql_query("SELECT * FROM subject"); while($row9 = mysql_fetch_array($kus)) { echo "<option value='$row9[subid]'>$row9[subname]</option>"; } ?> </select> Link to comment https://forums.phpfreaks.com/topic/274982-mysql_fetch_array-expects-parameter-1-to-be-resource/ Share on other sites More sharing options...
Jessica Posted February 26, 2013 Share Posted February 26, 2013 See the link in my signature, you need to check for MySQL errors. Do you really have the database named subject AND your table named subject? Link to comment https://forums.phpfreaks.com/topic/274982-mysql_fetch_array-expects-parameter-1-to-be-resource/#findComment-1415182 Share on other sites More sharing options...
lilmer Posted February 27, 2013 Share Posted February 27, 2013 Try to include this on your query or in every php sql command or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/274982-mysql_fetch_array-expects-parameter-1-to-be-resource/#findComment-1415283 Share on other sites More sharing options...
Sanjib Sinha Posted February 27, 2013 Share Posted February 27, 2013 Please do the error checking. http://php.net/manual/en/function.mysql-query.php Link to comment https://forums.phpfreaks.com/topic/274982-mysql_fetch_array-expects-parameter-1-to-be-resource/#findComment-1415310 Share on other sites More sharing options...
Christian F. Posted February 27, 2013 Share Posted February 27, 2013 Echo much..? Jessica already posted the answer, no need to repeat what she said. Especially with even less information. Better to spend your time, and energy, on someone who actually needs (more) help. Link to comment https://forums.phpfreaks.com/topic/274982-mysql_fetch_array-expects-parameter-1-to-be-resource/#findComment-1415354 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.