Hello, I searched on Google and in the forum archive for the answer and could not find it.

Here is my code for the display:

	while (($info = mysql_fetch_array($adminGetUser)) && ($info['admin'] != 'admin'))
	{
	echo $info['email']."<br>"; 
	}
	?>

The first row does not have 'admin' in its row so that shouldn't be a problem but just to make sure I took it off to test it and it still did not display the first row in the database.

Is there a work around or am I doing something wrong? Should I add a "filler row" every time I create a table?

Thanks for y'alls help.

    can we see some code BEFORE that?

    i'm betting that you have a line all alone like this:

    $info = mysql_fetch_array($adminGetUser)

    which is taking up the first result of the results array

    that is a common mistake, but w/o seeing more code, i'm merely speculating 🙂

      Ok, I will show you my database connection code.

      Typical Dreamweaver code

      mysql_select_db($database_ControlPanel, $ControlPanel);
      $query_adminGetUser = "SELECT * FROM cp_Users";
      $adminGetUser = mysql_query($query_adminGetUser, $ControlPanel) or die(mysql_error());
      $row_adminGetUser = mysql_fetch_assoc($adminGetUser);
      $totalRows_adminGetUser = mysql_num_rows($adminGetUser);

        You already retrieved the first row here:

        $row_adminGetUser = mysql_fetch_assoc($adminGetUser); 

          I see, Ok thanks...

          If I put the while loop in front of that, will the $row_adminGetUser still work?

            No.... all you're telling PHP to do is retrieve the next row from the MySQL result set. If you put the $row_adminGetUser statement after the loop, you won't get anything but a warning since all of the rows have already been retrieved.

            I don't really understand what you're trying to do with that...

              I am trying to display all the rows in a database, I just wanted to know if the loop would disrupt the code dreamweaver created.

              Thanks.

                Write a Reply...