Jump to content

Urgent Help Needed


jeeva

Recommended Posts

hi frnds,

 

i have used Php and Ms Access in my application.Now i want fetch the number of rows from the user master table.

For this i have used odbc_num_rows but its gives -1 whether its 0 or whatever.i don't know y

 

my code is

$chk=odbc_num_rows(odbc_exec($php121db,"select * from UserMaster where uname='$username' and password='$password'")) or die(odbc_errormsg());
echo "check value--".$chk;
if($chk>0)
	echo "vlaid Login";
else
	echo "Invalid Login";

 

Can u please tell me wts up?

Link to comment
https://forums.phpfreaks.com/topic/38726-urgent-help-needed/
Share on other sites

You have the or die() in the wrong set of parenthesis (and I think one too many?). Seperate this all out until you know what it's doing better.

What you have looks like this:

$ex = odbc_exec($php121db,"select * from UserMaster where uname='$username' and password='$password'");
$chk=odbc_num_rows($ex) or die(odbc_errormsg();

 

You want:

$ex = odbc_exec($php121db,"select * from UserMaster where uname='$username' and password='$password'") or die(odbc_errormsg();
$chk=odbc_num_rows($ex)

 

Also, read the article in my signature called how to ask questions - your title doesn't say anything about the problem...

Link to comment
https://forums.phpfreaks.com/topic/38726-urgent-help-needed/#findComment-186058
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.