MySQL Forums
Forum List  »  Microsoft SQL Server

help with output
Posted by: D2T
Date: October 11, 2004 05:19AM

Hi everyone,

The output of the second query in the following script doesn't work correctly. It keeps giving me incorrect numbers, randomly, mostly 20, 50, 13.. interesting. I would appreciate very much your help.

thanks!

<?php
$login = $_POST['login'];
$passwd = $_POST['passwd'];

@ $db = mysql_pconnect ("localhost", "xxx", "xxx");

mysql_select_db ("members");
$query1 = "select id from MEM where username='$login' and passwrd='$passwd'";
$result1 = mysql_query($query1);

if (mysql_num_rows($result1) < 1)
{
mysql_select_db ("members2");
$query = "select Custname from Customer where Username='$login' and Password='$passwd'";
$result = mysql_query($query);

if (mysql_num_rows($result) < 1)
{
echo "Dear Visitor,<br> Your login credentials are incorrect, please try again.";
}
else {
while ($row=mysql_fetch_array($result)) {
$name = $row["Custname"]; echo $name;
}
}}
else {
while ($row=mysql_fetch_array ($result1)) {
$a = $row["id"];
echo $a;
}
}
?>

Options: ReplyQuote


Subject
Written By
Posted
help with output
D2T
October 11, 2004 05:19AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.