PHP and Mysql relationship

wxdqz

New Member
I have been having a problem with really understanding how you can take your information from a form then compare it to what is in the database. I have been through numerous DOC files, Email Lists, and books. I apparently have not found anything to help me truly understand. I am still new at this and find myself trying to code in PHP like I would in PERL. Here is what I am doing.

$result = mysql_db_query ("accent", "select * from Customers WHERE CustID=$Pass1 AND CustNumb=$Pass2 AND CustName=$User");
if ( ! mysql_num_rows($result)) {
echo "<H1>Error!!! You do not have access or mistyped</h2>" ;
} else {

$webpage = "http://www.accentsystems.com";
$fp = fopen( $webpage, "r" ) or die ("COuld not open");
print fgets ( $fp, 1024) ;
}

I am basically taking a number and a name and seeing if they are in the database. If this is true and they match lets move on to the next page. I think my problem is that do not understand what (mysql_num_rows or mysql_fetch_object) to use here.

If anyone can help and/or point me in a direction to get a better understanding I would appreciate it.

Bill Marlin
 
Back
Top