Subject | RE: [firebird-php] - Learning a new language is tuff! |
---|---|
Author | Johan van Zyl |
Post date | 2004-11-21T22:58:47Z |
Hi
Thx!
Now I am stuck here in line 37
ibase_query("UPDATE users SET last_login_date = getdate() WHERE
userid='$userid'");
now() and getdate() gives me errors like
Warning: InterBase: Dynamic SQL Error SQL error code = -804 Function unknown
GETDATE in /home/e-smith/files/ibays/Primary/html/mc/checkuser.php on line
37
Greetings
Johan
-----Original Message-----
From: Nigel Weeks [mailto:nweeks@...]
Sent: 22 November 2004 00:11
To: firebird-php@yahoogroups.com
Subject: RE: [firebird-php] $login_check = ibase_num_rows($sql); problem
//Run the query, and put the record set into a variable called 'sql'
$sql = ibase_query("SELECT username, \"PASSWORD\" FROM users WHERE
username='$username' AND \"PASSWORD\"='$password' AND activated='1'");
// Fetch a row from the record set
$login_check = ibase_fetch_row($sql);
// Now, test a column in the record set
echo "Username is the first column, position zero: ".$login_check[0];
echo "PASSWORD is the second column, position one: ".$login_check[1];
// You could have used ibase_fetch_object, instead of ibase_fetch_row, and
used field names directly:
// Fetch a row from the record set AS ON OBJECT, instead of an array
$login_check = ibase_fetch_object($sql);
// get values from the returns
echo "Username is: ".$login_check->USERNAME;
echo "PASSWORD is: ".$login_check->PASSWORD;
Have fun!!
Nige.
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]
Thx!
Now I am stuck here in line 37
ibase_query("UPDATE users SET last_login_date = getdate() WHERE
userid='$userid'");
now() and getdate() gives me errors like
Warning: InterBase: Dynamic SQL Error SQL error code = -804 Function unknown
GETDATE in /home/e-smith/files/ibays/Primary/html/mc/checkuser.php on line
37
Greetings
Johan
-----Original Message-----
From: Nigel Weeks [mailto:nweeks@...]
Sent: 22 November 2004 00:11
To: firebird-php@yahoogroups.com
Subject: RE: [firebird-php] $login_check = ibase_num_rows($sql); problem
> This now worksYou're nearly there. You don't need ibase_fetch_array in your case:
> $sql = ibase_query("SELECT username, \"PASSWORD\" FROM users WHERE
> username='$username' AND \"PASSWORD\"='$password' AND activated='1'");
> $login_check = ibase_fetch_row($sql);
>
> if($login_check > 0){
> but ibase_fetch_array seems to be a problem and I cannot find
> the ibase
> equivalent in PHP manual ?
> while($row = ibase_fetch_array($sql)){
//Run the query, and put the record set into a variable called 'sql'
$sql = ibase_query("SELECT username, \"PASSWORD\" FROM users WHERE
username='$username' AND \"PASSWORD\"='$password' AND activated='1'");
// Fetch a row from the record set
$login_check = ibase_fetch_row($sql);
// Now, test a column in the record set
echo "Username is the first column, position zero: ".$login_check[0];
echo "PASSWORD is the second column, position one: ".$login_check[1];
// You could have used ibase_fetch_object, instead of ibase_fetch_row, and
used field names directly:
// Fetch a row from the record set AS ON OBJECT, instead of an array
$login_check = ibase_fetch_object($sql);
// get values from the returns
echo "Username is: ".$login_check->USERNAME;
echo "PASSWORD is: ".$login_check->PASSWORD;
Have fun!!
Nige.
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]