Re: [PHP] PHP and xemacs

2003-01-23 Thread Faisal Abdullah
I use Kate. Love it for the following features:

1. Wonderful customizable syntax highlighting not only for PHP, but
other languages/scripts as well. 

2. Splittable screen

3. Line numbering

4. A handy terminal emulator

5. Indent tracking, and brace tracking

6. Remembers recently opened files. I'll know what I've been working on.

7. Configurable tab spaces (I use 4 spaces)


Faisal


On Thu, 2003-01-23 at 16:47, Hans Jacob Simonsen wrote:
> Hi 
> 
> I have just started using xemacs as editor to my php scripts
> I think that the indentation in emacs stinks! xemacs has imorted a php
> package for med, but it does not make indentation on my html codes.
> 
> 
> 
> 
> 
> 
> 
> i would prefer looking like:
> 
> 
>
>  
> and so fourth. 
> 
> Is there a way I can do this automatically? Now I do it by pressing space
> a lot of times. I hope there is a package I can import. Maybe there is
> some shortcut I can press where I want my tabbing to be, something like:
> 
> 
>  [press short-cut here]
> [here I only need to press TAB to get the right indent]
> 
> Are there other nice editors for Linux RedHat?
> 
> Please help me. I really need it.
> 
> Jacob
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-- 
~~
Faisal Abdullah [EMAIL PROTECTED]
Systems Developer   Magnifix Sdn. Bhd.

Tel : 603-4142 1775 Fax : 603-4142 1550

~~
"Isn't it time you browse through a different window?"


__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] OOP

2002-12-12 Thread Faisal Abdullah
Hi guys,

It goes something like this:

class Myclass extends GtkWindow {

 var $run_xpm;
 var $pixmap;
 var $mask;

 function Myclass() {
   $this->run_xpm = array("bla", "bla");
   $this->GtkWindow(GTK_WINDOW_TOPLEVEL);
   $this->connect("destroy", array($this, shutdown));
   $this->set_title("Run");
   $this->set_border_width(10);
   $this->set_policy(false, false, false);
   $this->realize();
   list($this->pixmap, $this->mask) =
Gdk::pixmap_create_from_xpm_d($this, null, $this->run_xpm);
$this->icon = &new GtkPixmap($this->pixmap, $this->mask);

..
..
..
 }

}

In the main loop, i created an object of Myclass, and i get these error and warnings:

Warning:  pixmap_create_from_xpm_d() expects argument 1 to be GdkWindow or null, 
phprun given in /home/faisal/phprun.php on line 179
Warning:  gtkpixmap() expects argument 1 to be GdkPixmap, null given in 
/home/faisal/phprun.php on line 180
Fatal error:  Cannot create references to/from string offsets nor overloaded objects 
in /home/faisal/phprun.php on line 180

Any ideas?

-faisal-



__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Error in retrieving a BLOB from DB.

2002-11-27 Thread Faisal Abdullah
I've never used load() before, but I can't find it in the function list
in php.net


On Thu, 2002-11-28 at 11:05, Naif Al-Otaibi wrote:
> Hi all,
> 
> I use the following:
> 1) Win XP.
> 2) Oracle personal eddition 8.1.6.0.0.
> 3) IIS.
> 4) php-4.2.3-Win32 runs in cgi mode.
> 
> When I retrieve a blob from my DB, I got the following error:
> 
> Fatal error: Call to undefined function: load() in 
> c:\inetpub\wwwroot\php1\ora52.php on line 6
> 
> ---
> This is my code:
> 
>  $conn = OCILogon("system","manager","naif.localhost");
> $stmt = OCIParse($conn,"select binary_junk from images where img_id=7");
> OCIExecute($stmt);
> OCIFetchInto($stmt, $lob);
> $content=load($lob);
> OCIFreeStatement($stmt);
> OCILogoff($conn);
> header("Content-type: image/gif\n\n");
> echo $content;
> ?>
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-- 
~~
Faisal Abdullah [EMAIL PROTECTED]
Systems Developer   Magnifix Sdn. Bhd.

Tel : 603-4142 1775 Fax : 603-4142 1550

~~
"Isn't it time you browse through a different window?"


__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Do i need triggers for this?

2002-11-25 Thread Faisal Abdullah
> So, yes, I'd do this at an application level... although I have no idea what
> triggers are :)
> 

It does pretty much the same, only at the database level. The
application doesn't have to know. All the application needs to know is
to delete the id in the 'employee' table. Triggers will do the rest.

My guess is database level should perform better. I just simply don't
know how to right such triggers in postgresql. There docs are just not
enough for me.

> Justin French
> 
> http://Indent.com.au
> Web Development & 
> Graphic Design
> 
> 


__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Do i need triggers for this?

2002-11-25 Thread Faisal Abdullah
Hi guys,

Lets say I have a table called 'employees', and another table called
'training_history'.

Lets say I need to delete an employee, I would also have to delete his
record in the 'training_history' table.

Which is the best way to go about this? Controlling it at application
level? Or should I need triggers (I'm using postgresql). If the latter,
how do I create triggers for this kind of situation in postgresql?

Thanks.

Regards,
Faisal

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Sample Meeting Management System

2002-10-29 Thread Faisal Abdullah
Hi people,

Do you know where I can look at a free meeting management system?
Nothing too fancy, just something that does the job.
Thanks.

Regards,
Faisal

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Group by YEAR in date

2002-10-29 Thread Faisal Abdullah
Thanks guys.
It worked.

Regards,
Faisal

> -Original Message-
> From: 1LT John W. Holmes [mailto:holmes072000@;charter.net]
> Sent: Monday, October 28, 2002 10:17 PM
> To: Faisal Abdullah; [EMAIL PROTECTED]
> Subject: Re: [PHP] Group by YEAR in date
> 
> 
> > I have a table (postgres), with a date field (-mm-dd). How 
> do I group
> by
> > year?
> >
> > 'select sum(profit) from loan group by apply_date' would group 
> by the DAY,
> > not year.
> 
> SELECT SUM(profit) FROM load GROUP BY YEAR(apply_date)
> 
> ---John Holmes...
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Group by YEAR in date

2002-10-28 Thread Faisal Abdullah
Hi people,

I have a table (postgres), with a date field (-mm-dd). How do I group by
year?

'select sum(profit) from loan group by apply_date' would group by the DAY,
not year.
Thanks.

Regards,
Faisal

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




FW: [PHP] error connecting to oracle.

2002-10-28 Thread Faisal Abdullah


>
>
> > -Original Message-
> > From: Gerald Roehrbein/Pctdmn [mailto:groehrbein@;bigfoot.com]
> > Sent: Monday, October 28, 2002 10:50 AM
> > To: Subodh Gupta
> > Cc: [EMAIL PROTECTED]
> > Subject: RE: [PHP] error connecting to oracle.
> >
> >
> >
> > Hello,
> >
> >
> > at Solaris and Windows NT it's first necessary to install the
> > Oracle Client
> > software

I think this goes for all operating systems. The libraries required
are in oracle itself. No oracle, no libraries.

> >and then to configure PHP properly the way it is documented!
> > I've done until know only three PHP installations with Oracle
> support but
> > all three installations where very simple!
> >
> > Remember you have to set the Oracle Environmentvariables ($ORACLE_BASE,
> > $ORACLE_HOME, $TNS) before starting the WEB Server or PHP! For
> > apchache you can do this in apachectl or a subroutine you call from
> > apachectl.

Be sure to set the appropriate user and group (who has the environment
variables set) in httpd.conf

> >In a windows environment you have to set the variables
> > with the
> > appropriate tools (System/Environment/Add Variables)!
> >
> > In my cases this was  everything to do. Try your Oracle Client
> > Installation
> > with tnsping and sqlplus at your machine! This should work
> before you try
> > to configure PHP.
> >
> > best regards
> > Gerald
> >
>
Regards,
Faisal

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] error connecting to oracle.

2002-10-28 Thread Faisal Abdullah

If its not there, than I only see these possibilities:

1. You have not placed the correct dll's in the correct location.
2. You have not edited php.ini to in the extension section for oci8
3. You have not restarted apache after performing item [2] above

Regards,
Faisal

> -Original Message-
> From: Subodh Gupta [mailto:Subodh.Gupta@;seepz.tcs.co.in]
> Sent: Monday, October 28, 2002 5:56 PM
> To: Faisal Abdullah; [EMAIL PROTECTED]
> Subject: RE: [PHP] error connecting to oracle.
>
>
>
> There is no entry of oracle in any section.
> The rest of things which you have pointed out are already in place.
>
> How do I go aheadnow?
>
> Subodh Gupta
>
>
>
>
>
>
> "Faisal
>
> Abdullah" To: "Subodh Gupta"
> <[EMAIL PROTECTED]>,
>  <[EMAIL PROTECTED]>
> ix.com.my>cc:
>
>   Subject: RE: [PHP]
> error connecting to oracle.
> 28/10/2002
>
> 03:42 PM
>
>
>
>
>
>
>
>
>
> Where was it listed?
> In the 'configure command' section? Or the 'configuration' section?
> If its available in the 'configure command' ONLY, doesn't mean that its
> working properly.
>
> Also, check the following:
>
>
> 1.Copy d:\php\php4ts.dll to c:\winnt\system32 // depends on where your dll
> file is
>
> 2. Modify php.ini file for enable oci8 extension.
> Uncomment the php_oci8.dll line in c:\winnt\php.ini
> ;extension=php_mssql.dll
> extension=php_oci8.dll
> ;extension=php_openssl.dll
>
> 3. Edit extension_dir Location
> ; Directory in which the loadable extensions (modules) reside.
> extension_dir = "D:\PHP\extensions" // change this to whatever your
> extention directory is.
>
> Regards,
> Faisal
>
> -Original Message-
> From: Subodh Gupta [mailto:Subodh.Gupta@;seepz.tcs.co.in]
> Sent: Monday, October 28, 2002 5:35 PM
> To: Faisal Abdullah; [EMAIL PROTECTED]
> Subject: RE: [PHP] error connecting to oracle.
>
>
>
> I checked up phpinfo().  It does not have oracle listed.  What do
> I need to
> do now?
>
> Subodh Gupta
> Tata Consultancy Services.
>
>
>
>
> "Faisal
> Abdullah" To: "Subodh Gupta"
> <[EMAIL PROTECTED]>,
> 
> ix.com.my>cc:
>   Subject: RE: [PHP] error
> connecting to oracle.
> 28/10/2002
> 03:21 PM
>
>
>
>
>
>
> "undefined function" means PHP doesn't know where to get the
> function from.
> You probably didn't configure oci_8 libraries correctly.
> Try phpinfo(), and see under the configuration.
> Check whether oci8 is available.
>
> Regards
> Faisal
>
> -Original Message-
> From: Subodh Gupta [mailto:Subodh.Gupta@;seepz.tcs.co.in]
> Sent: Monday, October 28, 2002 5:18 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] error connecting to oracle.
>
>
>
> Hi all,
>
> I get the following error while trying to connect to oracle.  Please help
> me.
>
> Fatal error:  Call to undefined function:  ora_logon() in c:\program
> files\apache group\apache\htdocs\one.php on line 5
>
> Subodh Gupta
> Tata Consultancy Services.
>
>
> __
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> __
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] error connecting to oracle.

2002-10-28 Thread Faisal Abdullah
Heh..i just noticed something on your error:

>Call to undefined function:  ora_logon() in c:\program
>files\apache group\apache\htdocs\one.php on line 5

If you've configured OCI8, use:
ocilogon("scott","tiger",$db);

instead of ora_logon();

Regards,
Faisal

-----Original Message-
From: Faisal Abdullah [mailto:faisal@;magnifix.com.my]
Sent: Monday, October 28, 2002 6:13 PM
To: Subodh Gupta; [EMAIL PROTECTED]
Subject: RE: [PHP] error connecting to oracle.


Where was it listed?
In the 'configure command' section? Or the 'configuration' section?
If its available in the 'configure command' ONLY, doesn't mean that its
working properly.

Also, check the following:


1.Copy d:\php\php4ts.dll to c:\winnt\system32 // depends on where your dll
file is

2. Modify php.ini file for enable oci8 extension.
Uncomment the php_oci8.dll line in c:\winnt\php.ini
;extension=php_mssql.dll
extension=php_oci8.dll
;extension=php_openssl.dll

3. Edit extension_dir Location
; Directory in which the loadable extensions (modules) reside.
extension_dir = "D:\PHP\extensions" // change this to whatever your
extention directory is.

Regards,
Faisal

-Original Message-
From: Subodh Gupta [mailto:Subodh.Gupta@;seepz.tcs.co.in]
Sent: Monday, October 28, 2002 5:35 PM
To: Faisal Abdullah; [EMAIL PROTECTED]
Subject: RE: [PHP] error connecting to oracle.



I checked up phpinfo().  It does not have oracle listed.  What do I need to
do now?

Subodh Gupta
Tata Consultancy Services.




"Faisal
Abdullah" To: "Subodh Gupta"
<[EMAIL PROTECTED]>,

ix.com.my>cc:
  Subject: RE: [PHP] error
connecting to oracle.
28/10/2002
03:21 PM






"undefined function" means PHP doesn't know where to get the function from.
You probably didn't configure oci_8 libraries correctly.
Try phpinfo(), and see under the configuration.
Check whether oci8 is available.

Regards
Faisal

-Original Message-
From: Subodh Gupta [mailto:Subodh.Gupta@;seepz.tcs.co.in]
Sent: Monday, October 28, 2002 5:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] error connecting to oracle.



Hi all,

I get the following error while trying to connect to oracle.  Please help
me.

Fatal error:  Call to undefined function:  ora_logon() in c:\program
files\apache group\apache\htdocs\one.php on line 5

Subodh Gupta
Tata Consultancy Services.


__





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] error connecting to oracle.

2002-10-28 Thread Faisal Abdullah
Where was it listed?
In the 'configure command' section? Or the 'configuration' section?
If its available in the 'configure command' ONLY, doesn't mean that its
working properly.

Also, check the following:


1.Copy d:\php\php4ts.dll to c:\winnt\system32 // depends on where your dll
file is

2. Modify php.ini file for enable oci8 extension.
Uncomment the php_oci8.dll line in c:\winnt\php.ini
;extension=php_mssql.dll
extension=php_oci8.dll
;extension=php_openssl.dll

3. Edit extension_dir Location
; Directory in which the loadable extensions (modules) reside.
extension_dir = "D:\PHP\extensions" // change this to whatever your
extention directory is.

Regards,
Faisal

-Original Message-
From: Subodh Gupta [mailto:Subodh.Gupta@;seepz.tcs.co.in]
Sent: Monday, October 28, 2002 5:35 PM
To: Faisal Abdullah; [EMAIL PROTECTED]
Subject: RE: [PHP] error connecting to oracle.



I checked up phpinfo().  It does not have oracle listed.  What do I need to
do now?

Subodh Gupta
Tata Consultancy Services.




    "Faisal
Abdullah" To: "Subodh Gupta"
<[EMAIL PROTECTED]>,

ix.com.my>cc:
  Subject: RE: [PHP] error
connecting to oracle.
28/10/2002
03:21 PM






"undefined function" means PHP doesn't know where to get the function from.
You probably didn't configure oci_8 libraries correctly.
Try phpinfo(), and see under the configuration.
Check whether oci8 is available.

Regards
Faisal

-Original Message-
From: Subodh Gupta [mailto:Subodh.Gupta@;seepz.tcs.co.in]
Sent: Monday, October 28, 2002 5:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] error connecting to oracle.



Hi all,

I get the following error while trying to connect to oracle.  Please help
me.

Fatal error:  Call to undefined function:  ora_logon() in c:\program
files\apache group\apache\htdocs\one.php on line 5

Subodh Gupta
Tata Consultancy Services.


__





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] error connecting to oracle.

2002-10-28 Thread Faisal Abdullah
"undefined function" means PHP doesn't know where to get the function from.
You probably didn't configure oci_8 libraries correctly.
Try phpinfo(), and see under the configuration.
Check whether oci8 is available.

Regards
Faisal

-Original Message-
From: Subodh Gupta [mailto:Subodh.Gupta@;seepz.tcs.co.in]
Sent: Monday, October 28, 2002 5:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] error connecting to oracle.



Hi all,

I get the following error while trying to connect to oracle.  Please help
me.

Fatal error:  Call to undefined function:  ora_logon() in c:\program
files\apache group\apache\htdocs\one.php on line 5

Subodh Gupta
Tata Consultancy Services.


__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] A newbie on Board!

2002-10-28 Thread Faisal Abdullah

You should probably check whether you environment variables are all set.
try phpinfo(), and see under Environment Variables.

Check for:
ORACLE_SID
ORACLE_HOME
LD_LIBRARY_PATH
ORACLE_TERM
ORA_NLS33

If they aren't there, you should set them up.

Regards,
Faisal

-Original Message-
From: Subodh Gupta [mailto:Subodh.Gupta@;seepz.tcs.co.in]
Sent: Monday, October 28, 2002 3:11 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] A newbie on Board!



Hi all,

thanks for the prompt reply.

The problem is not that I don't know how to use functions and all.  I tried
using various function.  But I get fatal error everytime I use some
function.  I think, some extensions (dll files are missing in my
installation of php.)  how can I figure this out?

Subodh Gupta





"Peter
Houchin" To: "Subodh Gupta"
<[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]<[EMAIL PROTECTED]>
.au> cc:
 Subject: RE: [PHP] A newbie on
Board!
28/10/2002
12:02 PM






jump along to php.net/manual/en and have a look in there and it will show
ya
how to connect to oracle ( I can't remember :D ) also check out
phpbuilder.com and phpbeginner.com they'll both have tutorials for
connecting to oracle from memory :)

Cheers

> -Original Message-
> From: Subodh Gupta [mailto:Subodh.Gupta@;seepz.tcs.co.in]
> Sent: Monday, 28 October 2002 5:18 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] A newbie on Board!
>
>
> Hi,
>
> I have just started off myself to learn PHP.  I have installed PHP 4.2.3
> and Apache 1.3.27.  I have built some sample pages which are running
> fine.   But now I want to integrate PHP with Oracle.  Can somebody help
me
> how to do it ?
>
> Subodh Gupta
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] OCIFetchInto: OCI8 problem

2002-10-13 Thread Faisal Abdullah


I added a little $counter in the while loop.
The count shows 2.
But why do I only get one value?

Thanks,
Faisal

-Original Message-
From: Faisal Abdullah [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 14, 2002 9:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP] OCIFetchInto: OCI8 problem


Hi ppl.
I have something which seems really odd.

I run a SQL query, which is supposed to return 2 rows, but instead, it
returns one with
OCIFetchInto(). I used the exact same query in SQL*Plus, and It returns 2
rows like I want them.

Here's the code.


if(!$iDBConn = OCILogon(DB_USER, DB_PASS, DB_NAME))
echo "Failed to connect to Oracle database";

$stmt = OCIParse($iDBConn,"ALTER SESSION SET NLS_DATE_FORMAT='-MM-DD'");
 OCIExecute($stmt,OCI_DEFAULT);

$orasql = "SELECT * FROM gaj_ledjer_potongan WHERE no_gaji =
'".$id["salary_no"].
"'  AND kod_potongan = '09' AND tempoh_gaji LIKE '$year%'";

echo $orasql."";
$iStatement = @OCIParse($iDBConn, $orasql);
@OCIExecute($iStatement, OCI_DEFAULT);
$arrError = OCIError($iStatement);

if ($arrError['code']) {
print $arrError['message'];
exit;
}

$total_ded_sal = 0;
$deduction = $id["deduction"];
while(OCIFetchInto($iStatement, &$ora, OCI_ASSOC+OCI_RETURN_NULLS)) {
echo $ora['TEMPOH_GAJI']."";
}

p/s - I tried using a select * from table, and it returns more than one
rows(i suppose all the rows).

Thanks.

__


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] OCIFetchInto: OCI8 problem

2002-10-13 Thread Faisal Abdullah

Hi ppl.
I have something which seems really odd.

I run a SQL query, which is supposed to return 2 rows, but instead, it
returns one with
OCIFetchInto(). I used the exact same query in SQL*Plus, and It returns 2
rows like I want them.

Here's the code.


if(!$iDBConn = OCILogon(DB_USER, DB_PASS, DB_NAME))
echo "Failed to connect to Oracle database";

$stmt = OCIParse($iDBConn,"ALTER SESSION SET NLS_DATE_FORMAT='-MM-DD'");
 OCIExecute($stmt,OCI_DEFAULT);

$orasql = "SELECT * FROM gaj_ledjer_potongan WHERE no_gaji =
'".$id["salary_no"].
"'  AND kod_potongan = '09' AND tempoh_gaji LIKE '$year%'";

echo $orasql."";
$iStatement = @OCIParse($iDBConn, $orasql);
@OCIExecute($iStatement, OCI_DEFAULT);
$arrError = OCIError($iStatement);

if ($arrError['code']) {
print $arrError['message'];
exit;
}

$total_ded_sal = 0;
$deduction = $id["deduction"];
while(OCIFetchInto($iStatement, &$ora, OCI_ASSOC+OCI_RETURN_NULLS)) {
echo $ora['TEMPOH_GAJI']."";
}

p/s - I tried using a select * from table, and it returns more than one
rows(i suppose all the rows).

Thanks.

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Example script : Employee schedule

2002-09-25 Thread Faisal Abdullah

Hi people.
Does anyone happen to know whether there is a sample script/application out
there which can tell me (and everyone else in the organisation) of what
"john doe"
is doing, and where & when he's doing it?

I don't know a proper name for this type of application, therefor I haven't
found anything in google.
Thanks.

Sincerely,
Faisal

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] SQL : left join from multiple tables

2002-09-24 Thread Faisal Abdullah

Thanks for the help.
I got it working.

I used SQL92, instead of Oracle's sql standard.
I just hate to recode when migrating to mysql or postgresql.

Sincerely,
Faisal

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 7:33 PM
To: 'Faisal Abdullah'; [EMAIL PROTECTED]
Subject: RE: [PHP] SQL : left join from multiple tables


[snip]
"select a.name, b.department, c.position
from emp a
left join dept b
on a.staffno = b.staffno
left join position c
on a.staffno = c.staffno
where staffno = $staffno";

I know the statement above is totally wrong. I'm just hoping u guys can
understand what i'm trying to achieve from it.
[/snip]

All you have to change to make this right is change the ON statement after
'left join position c' to 'on b.staffno = c.staffno'. Remember that you are
moving from left to right in the join, so your ON must also move from left
to right.

HTH!

Jay

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] SQL : left join from multiple tables

2002-09-23 Thread Faisal Abdullah

Hi again people! How's it goin?

Here's the question
How do I do left joins from multiple tables?
I want to do something like this:

"select a.name, b.department, c.position
from emp a
left join dept b
on a.staffno = b.staffno
left join position c
on a.staffno = c.staffno
where staffno = $staffno";

I know the statement above is totally wrong. I'm just hoping u guys can
understand what i'm trying to achieve from it.

By the way, this is on Oracle 9i, but I guess ANSI would be fine.
Thanks again.

Sincerely,
Faisal

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Function: return multple values

2002-09-23 Thread Faisal Abdullah

Hi people.
Is it possible to return multiple values in a function.
For instance, i want to do something like this:

function calculate_money($sum)
 {
 // some hanky panky calculations
return $type;
return $amount;
 }

Thanks!

Sincerely,
Faisal 

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Auto-increment value

2002-09-18 Thread Faisal Abdullah

Hello people,
Thanks for all your help. I guess I'll go with

$oid = pg_last_oid($result);
select id from table where oid = $oid;

If i'm not mistaken, there will no race issue here:
pg_last_oid($result) has already returned me the row
that 'I' have just inserted, based on $result, regardless whether there is
another
user doing an insert. I already have a reference to a row i just inserted.

On the other hand,
BEGIN
INSERT ... whatever
SELECT idno ORDER BY (idno) DESC LIMIT 1;
END;

will have some 'time' between the 'insert' and the 'select'.
There is no reference to a row based on $result.
There would still probably be a race issue here (just my opinion,
not a fact). But if there's anyone could explain the internals,
I'd be glad.

Thanks for all who helped.

Sincerely,
Faisal




-Original Message-
From: Leonid Mamtchenkov [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 19, 2002 5:35 AM
To: Faisal Abdullah
Cc: Marek Kilimajer; PHP
Subject: Re: [PHP] Auto-increment value


Dear Faisal Abdullah,

Once you wrote about "RE: [PHP] Auto-increment value":
> > There is a similar one for postgresql as well: pg_last_oid() .
>
> I tried that. It gives me 24807, instead of 5.
> Or is oid is a reference to something else, which would
> lead me to the '5' i'm looking for?

I'd bet that 24807 is your oid.  Check the difference between
"SELECT * FROM table;" and "SELECT oid,* FROM table;".

HTH.

> -- snip snip --
>
> if($result = pg_exec($db, $sql))
> {
>   $query = "success";
>   echo "oid : " .pg_last_oid($result);
>   }
>
> -- snip snip --

--
Best regards,
  Leonid Mamtchenkov, RHCE
  System Administrator
  Francoudi & Stephanou Ltd.

BOFH: somebody was calculating pi on the server

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Auto-increment value

2002-09-18 Thread Faisal Abdullah



> There is a similar one for postgresql as well: pg_last_oid() .

I tried that. It gives me 24807, instead of 5.
Or is oid is a reference to something else, which would 
lead me to the '5' i'm looking for?

-- snip snip --

if($result = pg_exec($db, $sql))
{
$query = "success";
echo "oid : " .pg_last_oid($result);
}

-- snip snip --

Sincerely,
Faisal

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Auto-increment value

2002-09-18 Thread Faisal Abdullah

Thanks for your reply,
but I'm using postgresql.
Mysql is irrelevant for me.


-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 7:41 PM
To: PHP
Subject: Re: [PHP] Auto-increment value


MySQL has |LAST_INSERT_ID() function, try it ("SELECT ||LAST_INSERT_ID()")|

Faisal Abdullah wrote:

>Would a "select last_value from sequence_name" do any good?
>Is there a possibility that I get a value from the outcome of
>a nextval by another session?
>
>Meaning, I do an insert 1, 2, 3, 4
>A 'select last_value from sequence_name' should give me '4'.
>
>But what if another user/session does another insert/nextval(),
>before my select statement finishes processing? Would I get
>a 5?
>
>Sincerely,
>Faisal
>
>-Original Message-
>From: Faisal Abdullah [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, September 18, 2002 6:37 PM
>To: PHP
>Subject: RE: [PHP] Auto-increment value
>
>
>I tried that. It gives me 24807, instead of 5.
>Or is oid is a reference to something else, which would 
>lead me to the '5' i'm looking for?
>
>-- snip snip --
>
>if($result = pg_exec($db, $sql))
>{
>   $query = "success";
>   echo "oid : " .pg_last_oid($result);
>   }
>
>-- snip snip --
>
>Sincerely,
>Faisal
>
>-Original Message-
>From: Marek Kilimajer [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, September 18, 2002 5:42 PM
>To: PHP
>Subject: Re: [PHP] Auto-increment value
>
>
>As he uses postgresql, he should use *pg_last_oid()*
>
>Scott Houseman wrote:
>
>  
>
>>Hi there.
>>
>>You can use the function mysql_insert_id( [link id] ).
>>
>>regards
>>
>>Scott
>>
>>Faisal Abdullah wrote:
>>
>>
>>
>>>Hi people,
>>>
>>>I have a table with a column called ID (auto-increment).
>>>Is it possible to know the value of ID, right after inserting a row?
>>>I'm using postgresql.
>>>
>>>Thanks.
>>>
>>>Sincerely,
>>>Faisal
>>>
>>>__
>>>
>>>
>>>  
>>>
>>
>>
>
>
>  
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Auto-increment value

2002-09-18 Thread Faisal Abdullah

Would a "select last_value from sequence_name" do any good?
Is there a possibility that I get a value from the outcome of
a nextval by another session?

Meaning, I do an insert 1, 2, 3, 4
A 'select last_value from sequence_name' should give me '4'.

But what if another user/session does another insert/nextval(),
before my select statement finishes processing? Would I get
a 5?

Sincerely,
Faisal

-----Original Message-
From: Faisal Abdullah [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 6:37 PM
To: PHP
Subject: RE: [PHP] Auto-increment value


I tried that. It gives me 24807, instead of 5.
Or is oid is a reference to something else, which would 
lead me to the '5' i'm looking for?

-- snip snip --

if($result = pg_exec($db, $sql))
{
$query = "success";
echo "oid : " .pg_last_oid($result);
}

-- snip snip --

Sincerely,
Faisal

-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 5:42 PM
To: PHP
Subject: Re: [PHP] Auto-increment value


As he uses postgresql, he should use *pg_last_oid()*

Scott Houseman wrote:

> Hi there.
>
> You can use the function mysql_insert_id( [link id] ).
>
> regards
>
> Scott
>
> Faisal Abdullah wrote:
>
>> Hi people,
>>
>> I have a table with a column called ID (auto-increment).
>> Is it possible to know the value of ID, right after inserting a row?
>> I'm using postgresql.
>>
>> Thanks.
>>
>> Sincerely,
>> Faisal
>>
>> __
>>
>>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Auto-increment value

2002-09-18 Thread Faisal Abdullah

I tried that. It gives me 24807, instead of 5.
Or is oid is a reference to something else, which would 
lead me to the '5' i'm looking for?

-- snip snip --

if($result = pg_exec($db, $sql))
{
$query = "success";
echo "oid : " .pg_last_oid($result);
}

-- snip snip --

Sincerely,
Faisal

-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 5:42 PM
To: PHP
Subject: Re: [PHP] Auto-increment value


As he uses postgresql, he should use *pg_last_oid()*

Scott Houseman wrote:

> Hi there.
>
> You can use the function mysql_insert_id( [link id] ).
>
> regards
>
> Scott
>
> Faisal Abdullah wrote:
>
>> Hi people,
>>
>> I have a table with a column called ID (auto-increment).
>> Is it possible to know the value of ID, right after inserting a row?
>> I'm using postgresql.
>>
>> Thanks.
>>
>> Sincerely,
>> Faisal
>>
>> __
>>
>>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Auto-increment value

2002-09-18 Thread Faisal Abdullah

Hi people,

I have a table with a column called ID (auto-increment).
Is it possible to know the value of ID, right after inserting 
a row? 

I'm using postgresql.

Thanks.

Sincerely,
Faisal

__


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Hi How to convert the time from mysql(DATETIME) table to the format DD/MM/YYYY HH:MM AM or PM in PHP?

2002-03-12 Thread Faisal Abdullah

Try
date("d/m/Y h:m A");


On Tuesday 12 March 2002 18:29, Balaji Ankem wrote:
> Hi,
>   I have stored the date and time in mysql table with DATETIME
> type.
>
>   I want to change it in to DD/MM/ HH:MM AM or PM.
>
>   How can I do this?
>
> Thanks in advance
> Balaji

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] newbie: using sessions

2002-03-12 Thread Faisal Abdullah

Don't you have to assign the login value to the session variable first?

session_start();
$login = $HTTP_POST_VARS("login");
session_register("login");


> How are you using you're session? Are you registering the variable for
> later use?
>
> session_start();
> session_register("login");
>
> $login = $HTTP_POST_VARS['login'];
>
> That's it!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Variables within a string

2002-03-12 Thread Faisal Abdullah

I love your example..

> But if you don't know where the data came from then it's not secure.
> Consider a "real-life" example. Robin Hood steals the Sheriff's ATM card,
> and the Sheriff stupidly enough has written the PIN onto the back of the
> card. Now Robin can go and withdraw all the money from the Sheriff's
> account because the ATM has no way of knowing that the card was stolen (it
> doesn't know where the source of the data came from), all it knows is that
> the data is valid (right card, right PIN).

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] deleting records in mysql

2002-03-12 Thread Faisal Abdullah

The web interfaces probably failed to receive the ID of the row you wish to 
delete. What's the error message? Does the ID of the row you wish to delete 
appear in the "Delete" Link in the web interface?

Regards,
Faisal

On Tuesday 12 March 2002 17:35, you wrote:
> Hi to all,
>
> just want to ask why does the records in the table field sometimes failed
> to delete in using an interface such as using a delete mysql queries in PHP
> or even in a WEBMIN mysql gui interface. When it happens i need to manual
> delete the records using a command line.
> is there any bug in the the version of mysql im using?my php scripts failed
> when this happened. Im using mysql version 11.15 distribution 3.23.39 in
> redhat linux 6.2
>
>
> Regards,
> Mike

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] newbie: using sessions

2002-03-12 Thread Faisal Abdullah

Have you started session? And you have to register session variables as well.
Try this:

session_start();
$session_login = $HTTP_POST_VARS['login'];
session_register("session_login");


At the other page, where you want to output the variable, you must also start 
session.

session_start();
echo $session_login;

Regards,
Faisal

On Tuesday 12 March 2002 17:28, you wrote:
> Hi i can't get the session variables working.
>
> When I get something like
> $_SESSION['Login']=$HTTP_POST_VARS['login'];
> on the first page, and i go with a link to an other php page.
> When then try to get $_SESSION['Login'] again it is empty.
>
> How comes?
>
>
> Maarten Weyn

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File Upload

2002-03-11 Thread Faisal Abdullah


> > Warning: Unable to open 'C:\\Documents and
> > Settings\\vlad\\Desktop\\satellite\\florida.jpg' for reading: No such
> > file or directory in /var/www/kulchitski/btl/_talkroom_submit.php on
> > line 15

Well it says "Unable to open".
My guess is the file u want to upload doesn't exist.
What do u use to select the file?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] File Upload

2002-03-11 Thread Faisal Abdullah


> if(!userfile)
>echo "ERROR";
>
> $filelocation="/tmp";
Does C:\tmp exist?

>
> copy($userfile, $filelocation)
>
> The message I get in my browser is:

> Warning: Unable to open 'C:\\Documents and
> Settings\\vlad\\Desktop\\satellite\\florida.jpg' for reading: No such
> file or directory in /var/www/kulchitski/btl/_talkroom_submit.php on
> line 15

I wonder why PHP wants to OPEN florida.jpg.
Does c:\var\www\kulchitski/btl exist?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php