Jump to content

teletalky

Member
  • Posts

    1
  • Joined

  • Last visited

Posts posted by teletalky

  1. 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; ?>

×
×
  • Create New...