Hey All,
Well I'm looking for help here because I know I don't have to post page after page of code cause you know what most of it looks like.
So, now that the whole registering and logining/out of my members system works, I want to add some functionality to what they can do once their logged in. One of the basic things is to list all the members. I had a project in a php class a couple years ago that basically did this so I copied that code and changed what I thought I needed to change, but (of course, in my case) it doesn't work.
I get the error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in ....... on line 22
I've looked and looked at the code and just don't see whats wrong. Everything I saw when googling said check for spelling and that this error usually has to do with connecting to the database, but i know it connects, obviously i can login and such. So unless I'm using the connectToDB function wrongly...I just don't get it...Hope you can help me!
The code for this page is:
<?php
include_once("config.php");
// Check user logged in already:
checkLoggedIn("yes");
require("InnerHeader.php");
//Create a select all query string
$strSelectQuery = "SELECT email, last_name, first_name FROM users ORDER BY last_name";
//Aquire a result set with the function query
$rsMemberList = connectToDB($strSelectQuery);
//Display the list of records in the Result Set.
//Display a header name.
echo "<h2><b>List of all Members (by name):</b></h2>";
//Get the number of rows in the "users" table and store in $intNumRows
$intNumRows = mysql_num_rows($rsMemberList);
for( $i = 0; $i < $intNumRows; $i++)
{
echo "<br>";
$arrMembers = mysql_fetch_array($rsMemberList);
  {
    echo "<a href = \"MemberInfo.php?email=" . $arrMembers['email'] . "\">" . $arrMembers['last_name'] .", ". $arrMembers['first_name'] . "</a>";
  }
echo "<br>";
}
require("../Footer.php");
?>
$intNumRows = mysql_num_rows($rsMemberList); is line 22. I've looked above it, I've checked my query for typos...
It won't let me even get to the page if I'm not logged in so, check that works.
Header shows up, check that works.
I get the echoed "header name", check that works.
Then I get the error.
Footer shows up, check that works.
THANKS in advance!!