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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.