teletalky Posted September 10, 2013 Report Share Posted September 10, 2013 I am new to PHP, and while following the tutorial from the videos (MySQL, SQL & PHP) I kept on getting the following error message: Notice: undefined variable: my_rows in c:\... However, the variable 'my_rows' has been declared, as shown on the code below. I have made change on the php.ini (error_reporting) without success. Can anyone help??? $query = "SELECT * FROM people"; $result = mysql_query($query); $my_rows; while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $my_rows = $my_rows . "Name : {$my_rows['name']} <br>" . "id : {$row['id']} <br><br>"; } mysql_close($my_connection); ?> </head> <body> <?php echo $my_rows; ?> Quote Link to comment 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.
Note: Your post will require moderator approval before it will be visible.