|
Posted by Jerim79 on 11/21/06 21:58
linda wrote:
> "MS" <MS@nospam.com> wrote in message
> news:85Wdncqr-41Msv7YnZ2dnUVZ8qCdnZ2d@bt.com...
> >> $query="SELECT FNAME, LNAME FROM (table) WHERE FNAME=('$FName') AND
> >> NAME=('$LName')";
> >
> > And what does $result contain?
>
> $result=mysql_query($query); /* ask how many rows the query generated and
> return that value */
> return mysql_num_rows($result);
>
> >
> > Should the NAME field be LNAME ?
> >
> You've already supplied that it the query!
>
> :-)
>
> Best wishes,
> Linda
Thank you everyone. I was able to get it to work. Really, all I had to
do was:
$numRows=mysql_num_rows($result);
if($numbRows>1{
//Perform some action
}
else{
//Peform some other action
}
I was writing the script for someone else. Not really sure what he
wanted it for. He just said to make sure that it checks the database
for that name and that he would fill in the IF/ELSE conditions. So at
least I have given him a workable solution. I like the idea of the
function, especially if I have to do this again with the idea of it
being for a lot of users. I showed it to him and he seems pleased for
now. I appreciate everyone's help. Hopefully I can be of help in the
future.
Navigation:
[Reply to this message]
|