sash11 Posted February 21, 2010 Share Posted February 21, 2010 <?php if (isset($_REQUEST['submit'])) { echo "<p> hello</p>"; $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'shshsh11'; mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'Studentt'; mysql_select_db($dbname); $result = mysql_query("SELECT * FROM `allele`"); print $result; } else { ?> <html> <body> <form action="wcode.php" method=POST> <P><strong>Available Queries</strong><br> <INPUT TYPE="radio" NAME="Microsatellite Primers">Microsatellite Primers<br> <INPUT TYPE="radio" NAME="Maps">Maps for specified loci, possibly on a specified chromosome<br> <INPUT TYPE="radio" NAME="Common loci">Loci in common between two maps<br> <INPUT TYPE="radio" NAME="Loci">Loci on more than 4 maps<br> <P><P><P><input name=submit type=submit value=submit> </form> </body> </html> <?php } ?> it gives following result hello Resource id #3 what is Resource id #3 how do we solve it? please help Link to comment https://forums.phpfreaks.com/topic/192796-resource-id-3-error/ Share on other sites More sharing options...
jl5501 Posted February 21, 2010 Share Posted February 21, 2010 you are trying to print the result from the query, which is a mysql result resource. You next need to fetch the data as mysql_fetch_assoc($result) OR mysql_fetch_object($result) depending on how you want the data. Then you can print 1 item from that Link to comment https://forums.phpfreaks.com/topic/192796-resource-id-3-error/#findComment-1015573 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.