Subject RE: [firebird-php] $login_check = ibase_num_rows($sql); problem
Author Johan van Zyl
Thx
Now I get
Warning: InterBase: Dynamic SQL Error SQL error code = -104 Token unknown -
line 1, char 18 password in
/home/e-smith/files/ibays/Primary/html/mc/checkuser.php on line 20

Warning: Supplied argument is not a valid InterBase result resource in
/home/e-smith/files/ibays/Primary/html/mc/checkuser.php on line 21
here are lines 20 & 21
$sql = ibase_query("SELECT username, password FROM users WHERE
username='$username' AND password='$password' AND activated='1'");
$login_check = ibase_fetch_row($sql);
-----Original Message-----
From: Lucian Busoniu [mailto:trieper_codename47@...]
Sent: 21 November 2004 12:30
To: firebird-php@yahoogroups.com
Subject: Re: [firebird-php] $login_check = ibase_num_rows($sql); problem




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
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>


=====

luxi




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






Yahoo! Groups Sponsor
ADVERTISEMENT





----------------------------------------------------------------------------
--
Yahoo! Groups Links

a.. To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-php/

b.. To unsubscribe from this group, send an email to:
firebird-php-unsubscribe@yahoogroups.com

c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---
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


[Non-text portions of this message have been removed]