php-windows Digest 23 Sep 2004 18:27:11 -0000 Issue 2407
Topics (messages 24637 through 24641):
Re: Strange result returned from Oracle
24637 by: Mikey
Re: Date Formatting
24638 by: Mikey
Re: PHP Image creation
24639 by: Mikey
Oracle statement handles... or resources in general
24640 by: Mikey
Re: Installation Woes.
24641 by: memoimyself.yahoo.com.br
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Thanks!
I am still puzzled as to why it should return that value though :-/
Mikey
----- Original Message -----
From: "Francesco" <[EMAIL PROTECTED]>
Newsgroups: php.windows
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 22, 2004 2:17 PM
Subject: Re: Strange result returned from Oracle
> Mikey,
> I would put the if condition (or a while loop, if you are retrieving more
> than 1 row) around the ocifetchinto, and not after that, as in your code.
> Here is how I would write it (off my head, not tested):
>
> $sql = "SELECT \"irpUser\" FROM tblUsers WHERE
> \"swmEmail\"='{$_POST['swmEmail']}'";
> $sth = ociparse ($conn, $sql) or die ("Couldn't parse SQL: $sql<br>\n");
> ociexecute ($sth) or die ("Couldn't execute SQL: $sql<br>\n");
> if (ocifetchinto ($sth, $usr, OCI_ASSOC)) {
> // Do stuff here with $usr['irpUser']
> }
> else {
> // No rows returned here
> }
>
> HTH
> Francesco
> --------------------------
> "Mikey" <[EMAIL PROTECTED]> wrote:
> >I have
> > the following code:
> >
> > $sql = "SELECT \"irpUser\" FROM tblUsers WHERE
> > \"swmEmail\"='{$_POST['swmEmail']}'";
> > $sth = ociparse ($conn, $sql)
> > or die ("Couldn't parse SQL: $sql<br>\n");
> > ociexecute ($sth)
> > or die ("Couldn't execute SQL: $sql<br>\n");
> > ocifetchinto ($sth, $usr, OCI_ASSOC);
> > if ($usr['irpUser'] == "")
> > {
> > // Do stuff here
> > }
> > else
> > {
> > //Something else
> > }
> >
> > Now, when the query brings back a record everything works fine, but when
> the
> > query returns nothing (i.e. brand new user) it still goes to the else
> branch
> > of the code. I have echo'ed $usr to the screen and it contains the
string
> > "SYSTEM". Now as far as my code goes I don;t think this is too much of
a
> > problem as I can just check for this string (normal values are integer),
> but
> > I can find no reference to this behaviour in the docs and would like to
> know
> > what is causing this return value. Any ideas?
> >
> > Mikey
> > ---
> > Developer - Radius Design Ltd.
--- End Message ---
--- Begin Message ---
Have you looked at the strtotime() function? Off the top of my head, it
should look a bit like this:
$out = date ("m/d/Y", strtotime ("Sep 12 2004 2:16AM"));
HTH,
Mikey
----- Original Message -----
From: "Ron Herhuth" <[EMAIL PROTECTED]>
Newsgroups: php.windows
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 22, 2004 2:12 PM
Subject: Date Formatting
>
> I see in the manual about how to format the current date using the date()
> function...but my question is...I have the date in this format:
> Sep 12 2004 2:16AM
>
> And I needed it formatted as:
> 09/12/2004 (I don't need the time)
>
> How do I go about doing that?
>
> Thanks,
> Ron
>
>
>
>
>
>
--- End Message ---
--- Begin Message ---
No there is no way to inline an image using HTML. The output from phpinfo()
shows the following code for the image:
<img border="0" src="/test.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42"
alt="PHP Logo" />
This is actually how the PHP Easter egg works too - try appending
"?=PHPE9568F34-D428-11d2-A769-00AA001ACF42" to any PHP page.
Mikey
----- Original Message -----
From: "Riaan Stander" <[EMAIL PROTECTED]>
Newsgroups: php.windows
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 22, 2004 10:45 PM
Subject: PHP Image creation
> Hi
>
> I'm using the GD library to create images from data in a database.
> Currently I call a php page as my image source and all the code for the
> image generation is in this page, eg: <img src="image.php">
>
> Is there any way you can do the same thing but just calling a function
> in the current php file, rather than having to create the extra
> image.php file. If you have a look of the output of phpinfo the zend
> logo seems to be generated in such a way.
>
> Thanks,
> Riaan Stander
--- End Message ---
--- Begin Message ---
Hi NG!
Consider the following piece of (simplified) code:
$sql = "SELECT * FROM table";
$sth = ociparse ($conn, $sql);
ociexecute ($sth);
$sql = "SELECT * FROM table2";
$sth = ociparse ($conn, $sql);
ociexecute ($sth);
I have just been reading an article on php|arch that states that each open
statement handle in Oracle represents a cursor, and given that I am using
persistent connections will hold resources until the Apache child thread
terminates. Now, my question is whether, by using the same variable for the
statement handle, the previous resources are deallocated, or whether I am
just piling up loads of cursors on the database?
Mikey
---
Developer - Radius Design Ltd.
--- End Message ---
--- Begin Message ---
Jim,
Below are a few comments and questions for you:
On 22 Sep 2004 at 6:41, Jim Bailey wrote:
> I'm a well seasoned developer dipping my toe into PHP/Apache/MySQL.
> I installed Mozilla FireFox Version 0.9.3 and
> PHP4.3.8 and
> Apache 1.3.31 running in
> Windows 2000 Version 5 SP 4.
Fine, but FireFox has nothing to do with anything. Which browser you use has no impact
on the way your web server works, except for the identification string the browser
sends to
the server each time a page is requested.
> I appended the following lines to httpd.conf
> ScriptAlias /php4/ "E:/Programs/PHP4.3.8/"
>
> AddType application/x-httpd-php4 .php4 .phtml .php
>
> Action application/x-httpd-php4 "php.exe"
Why did you decide to install PHP as a CGI binary? Did you read the installation file
that
comes with the PHP package (install.txt)? Did you not see the line that reads "Note,
we
consider installing PHP like this suicidal"?
I suggest you replace those lines you inserted in httpd.conf with these:
LoadModule php4_module E:/Programs/PHP4.3.8/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php
Good luck,
Erik
--- End Message ---