Hello all,
  I am trying to get this script to INSERT a couple of records into my DB, but 
I am getting these errors.  I know the second warning has nothing to do with 
MySQL, so I will work on figuring out that portion later today.


Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result 
resource in c:\program files\easyphp1-8\www\test\username.php on line 7
The following users on yoursystem are:

Warning: Invalid argument supplied for foreach() in c:\program 
files\easyphp1-8\www\test\username.php on line 9


I am not sure why this is is happening, but my PHP script goes like this...

<script>
<?php

if (isset($_POST['submit'])) {
  require_once ('mysql_connect-local.php'); // Connect to the database.
  $query = "SELECT * FROM users ORDER BY username ASC";
  $result = @mysql_query($query);
  $row = mysql_fetch_array($result, MYSQL_NUM);
  echo "The following users on yoursystem are:<br />";
  foreach ($_POST['users'] AS $users) echo 
"<table><tr><td>$user_id</td><td>$username</td><td>$firstname</td><td>$lastname</td><td>$email</td></tr></table>";
}

?>
</script>

Any help is appreciated.

Nick

Reply via email to