Subject Re: [firebird-php] $login_check = ibase_num_rows($sql); problem
Author Lucian Busoniu
There is no ibase_num_rows ;;)

You need to ibase_fetch_row() in order to check if there are any
results.

Also, take care, the arguments order for some similar functions is
diferrent between the mysql and ibase extensions.

--- Johan van Zyl <johan@...> wrote:

>
>
> I did a serach an replace - from mysql to ibase
> but it doe snot like
> $login_check = ibase_num_rows($sql); ?????
> How do I solve this problem?
>
> <?
> /* Check User Script */
> session_start(); // Start Session
>
> include 'db.php';
> // Convert to simple variables
> $username = $_POST['username'];
> $password = $_POST['password'];
>
> if((!$username) || (!$password)){
> echo "Please enter ALL of the information! <br />";
> include 'login_form.html';
> exit();
> }
>
> // Convert password to md5 hash
> $password = md5($password);
>
> // check if the user info validates the db
> $sql = ibase_query("SELECT username, password FROM users WHERE
> username='$username' AND password='$password' AND activated='1'");
> $login_check = ibase_num_rows($sql);
>
> if($login_check > 0){
> while($row = ibase_fetch_array($sql)){
> foreach( $row AS $key => $val ){
> $$key = stripslashes( $val );
> }
> // Register some session variables!
> session_register('first_name');
> $_SESSION['first_name'] = $first_name;
> session_register('last_name');
> $_SESSION['last_name'] = $last_name;
> session_register('email_address');
> $_SESSION['email_address'] = $email_address;
> session_register('special_user');
> $_SESSION['user_level'] = $user_level;
>
> ibase_query("UPDATE users SET last_login_date=now() WHERE
> userid='$userid'");
>
> header("Location: login_success.php");
> }
> } else {
> echo "You could not be logged in! Either the username and password
> do not
> match or you have not validated your membership!<br />
> Please try again!<br />";
> include 'login_form.html';
> }
> ?>
>
> ========================
> Johan van Zyl
> JVZ Systems CC
> Box 3469
> Somerset West
> 7129
> johan@...
> http://www.jvz.co.za
> +27 (0)82 875 4238
> +27 (0)21 851 7205
> Fax 088 021 852 2387
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.799 / Virus Database: 543 - Release Date: 2004/11/19
>
>
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> --------------------~-->
> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
> Now with Pop-Up Blocker. Get it for free!
> http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/PhFolB/TM
>
--------------------------------------------------------------------~->
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>


=====

luxi




__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com