naggih Posted June 19, 2010 Share Posted June 19, 2010 hello there, i need some help,i'm using wampser, i've written my php scripts to collect and update data in mysql server but when i try to load the php page, i get such kind of eror messages as below hello, here are the currently registered students Invalid query: No database selected i intend to display the records of table of registerd students, below is the code i used <html> <head> <title> the result for the requested records </title> </head> <body> <h3> hello, here are the currently registered students</h3> <?php $db = mysql_connect("localhost"); mysql_select_db("regsys",$db); $query = "select * from stdnt_record"; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while(list($fieldname,$fieldvalue) = each($record)) { echo $fieldname.":".$fieldvalue.":<br>"; } echo "<br>"; } ?> </body> </html> thakyou. naggi Quote Link to comment https://forums.phpfreaks.com/topic/205260-error-with-my-php-script/ Share on other sites More sharing options...
RichardRotterdam Posted June 19, 2010 Share Posted June 19, 2010 hello there, i need some help,i'm using wampser, Sorta sounds like wankster use for your code. <html> <head> <title> the result for the requested records </title> </head> <body> <h3> hello, here are the currently registered students</h3> <?php $db = mysql_connect("****"); mysql_select_db("****",$db); $query = "select * from stdnt_record"; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)) { while(list($fieldname,$fieldvalue) = each($record)) { echo $fieldname.":".$fieldvalue.":<br>"; } echo "<br>"; } ?> </body> </html> What is the error you get? Quote Link to comment https://forums.phpfreaks.com/topic/205260-error-with-my-php-script/#findComment-1074387 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.