[PHP] mssql_num_rows problem

2003-06-27 Thread Gary Ogilvie
Hello everyone,
 
I am trying to grab some data from a table in a database. Here is the
code I am using:
 
$myServer = 192.92.0.248;
$myUsername = Admin;
$myPassword = bluefish;
$myDB = COMPANY;
 
$myUser = $_GET['user'];
$myPass = $_GET['pass'];
 
#print ($myUserbr$myPass);
 
$s = mssql_connect($myServer, $myUsername, $myPassword)
or die;
 
$d = mssql_select_db($myDB, $s)
or die;
 
$query = SELECT * FROM users WHERE user = '$myUser';
 
print ($query);
 
$result = mssql_query($query)
or die;
 
$numRows = mssql_num_rows($result);
 
print ($numRows);
 
When printing out the query the correct statement is being sent to
MSSQL. The variable $myUser does in face match what is in the database.
However when I print the variable $numRows I am getting a 0. So no
rows are being sent back - how can this be so when what is being sent to
the database does in fact match a record in the table. I am mostly
puzzled - PHP is set up correctly as I have been using this sort of
thing with other projects.
 
All help is very deeply appreciated.
 
Gary


RE: [PHP] mssql_num_rows problem

2003-06-27 Thread Jay Blanchard
[snip]
$numRows = mssql_num_rows($result);
 
print ($numRows);
[/snip]

A. print($query); //to make sure it is correct, double check
2. print($numRows); // no quotes, again to test

HTH

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mssql_num_rows problem (Solved)

2003-06-27 Thread Gary Ogilvie
Thanks a lot Jay

It seems that when a password type of form is used then you must send
the password variable to the database instead of the user...Strange but
it works !!

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2003 13:45
To: Gary Ogilvie; PHP General
Subject: RE: [PHP] mssql_num_rows problem

[snip]
$numRows = mssql_num_rows($result);
 
print ($numRows);
[/snip]

A. print($query); //to make sure it is correct, double check
2. print($numRows); // no quotes, again to test

HTH


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php