php-general Digest 27 May 2002 08:50:33 -0000 Issue 1369

Topics (messages 99318 through 99344):

Re: Simulating a FORM POST thing (HELP!)
        99318 by: Peter
        99319 by: Georgie Casey

Problem with Includes and Variables
        99320 by: Pete Rippe

--NEWBIE-- T_String parse error ??
        99321 by: Kevin J
        99322 by: Rasmus Lerdorf

Re: ini_set('register_globals',0) doesn't work
        99323 by: Rasmus Lerdorf

Re: PHP and JavaScript
        99324 by: Mark

Pulling one record from a db(newbie)
        99325 by: webmaster.tececo.com
        99326 by: David Robley

passing variable to anti spam mailto script
        99327 by: Greg Wright

Validating forms and showing errors
        99328 by: Victor Boivie
        99329 by: Martin Towell
        99336 by: David Freeman

Parse Error(Newbie)
        99330 by: webmaster.tececo.com
        99331 by: Martin Towell
        99332 by: Peter
        99333 by: David Robley
        99335 by: David Freeman
        99337 by: Miguel Cruz

Ora_Fetch_Into function problem
        99334 by: Michael P. Carel
        99339 by: Miguel Cruz
        99342 by: Michael P. Carel
        99343 by: Michael Virnstein
        99344 by: Michael P. Carel

Re: Problem with if statement and while loops
        99338 by: Jason Wong

Re: using array to declare globals in function?
        99340 by: Jason Wong

Re: how to display a file's last updated time using php?
        99341 by: Michael Virnstein

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 ---
Windows Bitmap = BMP file
a WBMP is a wireless bitmap image and is designed for display on mobile
phones. A lot of software doesn't understand the format.

You need to use createfrombmp() not createfromwbmp()


"Georgie Casey" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> i'm getting an error message saying my BMP file i'm trying to convert isnt
a
> valid WBMP file? is dere a difference between BMP and WBMP? I just opened
my
> GIF file into PSP7 and and saved as a windows bmp.
>
> why isnt it working?
> "Peter" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > <?PHP
> > $im = createfrombmp("image");
> > print "<FORM METHOD=\"post\" ACTION=\"actionpage.php\">";
> > print "<INPUT TYPE=\"hidden\" NAME=\"image\" VALUE=\"$im\">";
> > ?>
> > you get the idea
> >
> > I think PHP does have other funtions for file uplading though.
> >
> > "Georgie Casey" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Rite, when you see a web form, you know you can simulate the submit by
> > > filling in the values in the address field, just like a GET method,
and
> it
> > > usually works the exact same. But how do you do it when one of the
> fields
> > in
> > > the form is a file upload?!?!?!
> > >
> > > For the record, its a GIF file you've to upload. Is there any way to
do
> > this
> > > in PHP??
> > >
> > >
> > >
> > >
> >
> >
>
>


--- End Message ---
--- Begin Message ---
that function doest exist!

"Peter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Windows Bitmap = BMP file
> a WBMP is a wireless bitmap image and is designed for display on mobile
> phones. A lot of software doesn't understand the format.
>
> You need to use createfrombmp() not createfromwbmp()
>
>
> "Georgie Casey" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > i'm getting an error message saying my BMP file i'm trying to convert
isnt
> a
> > valid WBMP file? is dere a difference between BMP and WBMP? I just
opened
> my
> > GIF file into PSP7 and and saved as a windows bmp.
> >
> > why isnt it working?
> > "Peter" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > <?PHP
> > > $im = createfrombmp("image");
> > > print "<FORM METHOD=\"post\" ACTION=\"actionpage.php\">";
> > > print "<INPUT TYPE=\"hidden\" NAME=\"image\" VALUE=\"$im\">";
> > > ?>
> > > you get the idea
> > >
> > > I think PHP does have other funtions for file uplading though.
> > >
> > > "Georgie Casey" <[EMAIL PROTECTED]> wrote in message
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > Rite, when you see a web form, you know you can simulate the submit
by
> > > > filling in the values in the address field, just like a GET method,
> and
> > it
> > > > usually works the exact same. But how do you do it when one of the
> > fields
> > > in
> > > > the form is a file upload?!?!?!
> > > >
> > > > For the record, its a GIF file you've to upload. Is there any way to
> do
> > > this
> > > > in PHP??
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


--- End Message ---
--- Begin Message ---
Hey, im running Apache 2.0.36, and PHP 4.2.1, and im having problems with my site, 
which relies alot on includes. On each site page, it includes a file called 
"global.php" which contains the path's to the include folder, and various other 
directories needed. After that, it includes files for the site layout, which use 
variables from the global.php file. They all load fine, and in each included file, it 
is correctly processed by php, but for some reason, the variables that worked for 
including the files from global.php, aren't seen in the includes. Kinda get what im 
saying? I cant figure out how to have all the files first included, and then processed 
as one big file, instead of smaller files.

Thanks!

--Pete
--- End Message ---
--- Begin Message ---

Hello all,

I am new to PhP, and I just bought the Beginning PhP 4 book, and i got my
first parse error, and I have no idea what it is i done wrong, cause its not
covered in this book!!!

this is the message i get:

Parse error: parse error, unexpected T_STRING in
c:\inetpub\wwwroot\example1.php on line 1


What does this mean? and how can i fix it?

Thank you!

Kevin J
--
http://www.wishpocket.com



--- End Message ---
--- Begin Message ---
You probably missed a quote or something.  Show us line 1.

On Sun, 26 May 2002, Kevin J wrote:

>
> Hello all,
>
> I am new to PhP, and I just bought the Beginning PhP 4 book, and i got my
> first parse error, and I have no idea what it is i done wrong, cause its not
> covered in this book!!!
>
> this is the message i get:
>
> Parse error: parse error, unexpected T_STRING in
> c:\inetpub\wwwroot\example1.php on line 1
>
>
> What does this mean? and how can i fix it?
>
> Thank you!
>
> Kevin J
> --
> http://www.wishpocket.com
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
register_globals affects things that happen before PHP parsing begins, so
by the time you get to your ini_set() it is too late.  So no, that won't
work.  You need to set it in your php.ini, httpd.conf or .htaccess.

-Rasmus

On Sun, 26 May 2002, Jens Lehmann wrote:

> I tested ini_set('register_globals',0) and ini_set('register_globals','Off')
> for turning register_globals off. It doesn't work and it doesn't produce any
> notice, warning or error.
>
> Here's a quick example:
>
> <?php
>
> ini_set('register_globals',0);
>
> if(isset($test))
>   echo "<h2>$test</h2>";
>
> ?>
> <form action="ini_set.php" method="get">
>  <input type="text" name="test" />
>  <input type="submit" />
> </form>
>
> This prints out $test, what it shouldn't do with register_globals turned
> off.
> I tested this with PHP 4.1.2 and 4.2.1. Even if I start to doubt it is
> supposed to work according to the documentation. Can anyone tell
> me what I've done wrong?
>
> For some strange reason if I do
>
> echo ini_set('register_globals',0);
>
> it will print "10". For
>
> echo ini_set('register_globals','Off');
>
> it will print "1Off".
>
> Jens
>
> PS: ini_set works fine with include_path and error_reporting
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
On Sun, 26 May 2002 10:05:03 +0300, mp wrote:
>Hi, php-general,
>
>I make this kind of PHP script(script.php):
>script.php
><?
>$variable = "Some some long long Text Blah blah";
>echo "document.write(\"".$variable."\")";
>?>
>
>And in HTML (other.html) file I write:
><script language="JavaScript" src="script.php"></script>
>
>But there is some mistake. Does anybody can help me?
>Thanks...
>
>

make sure $variable doesn't have any newlines.

--- End Message ---
--- Begin Message ---
Hi,

I know how to use limit to pull 2 or more records out of a database.

What I wish to do is only pull one record from a database.

I am using the following query:
$query = "select * from news limit LIMIT $id, ++id";

I get all sorts of parse errors and stuff.

Please Help.

Also is there a function to return only one record?

JJ Harrison
www.tececo.com
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
In article <034501c2052b$0b8abed0$0100a8c0@JohnH>, [EMAIL PROTECTED] 
says...
> Hi,
> 
> I know how to use limit to pull 2 or more records out of a database.
> 
> What I wish to do is only pull one record from a database.
> 
> I am using the following query:
> $query = "select * from news limit LIMIT $id, ++id";
> 
> I get all sorts of parse errors and stuff.
> 
> Please Help.
> 
> Also is there a function to return only one record?
> 
> JJ Harrison
> www.tececo.com
> [EMAIL PROTECTED]
> 

$query = "select * from news LIMIT 1";

and if you want a particular order you need to add ORDER BY (ASC or DESC) 
depending on your exact need.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
Hello All,

What is the best way (or opinions rather) to pass variables to a anti spam
script.

This is used in place of mailto links in webpages, but am looking for any
simple way to pass information so more than one address can easily be used
in the script, I could use mysql or other, however want to have something
easier than this.

Suggestions ?  (please CC me if mailing to the list) , any examples ?

<?PHP
$mailto = 'mailto:[EMAIL PROTECTED]';
header("Location: $mailto");
?>

TIA

--- End Message ---
--- Begin Message ---
Hi everybody,

This might be a RTFM or STFW-question, but I haven't found it.

I want to validate a form (in page1.php) to check if the user has entered a
correct email-adress and more, and if he needs to correct some fields, I'd
like to display the form again with all correct values filled in and the
incorrect fields hightlighted.

To make it a bit more difficult I've decided to POST to another file
(post.php) which validates the information and redirects the user (with
Header - Location) to page1.php if he has to correct the errors. If the form
is correctly filled in then he will be redirected to page2.php. This is to
prevent the browser for asking him if he wants to repost data if he hits
'Refresh'. Now I want to know how to pass information from post.php to
page1.php since the form page (page1) needs to know what was incorrect and
what was correct so that it can hightlight the bad fields. I don't want to
stick it in the URL since it would be too ugly, but I do have session
variables I can stick them in. Is this the way to go? Or is there a better
solution?

I guess many of you have fought with this before so I know you can help me
;)

Thanks in advance,
Victor
--- End Message ---
--- Begin Message ---
These are the five methods I know of getting the data back to the original
form.

1. Client side cookies
2. Server side cookies/session variables
3. URL
4. hidden form
5. submit back on yourself

Take your pick
Martin

-----Original Message-----
From: Victor Boivie [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 27, 2002 3:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Validating forms and showing errors


Hi everybody,

This might be a RTFM or STFW-question, but I haven't found it.

I want to validate a form (in page1.php) to check if the user has entered a
correct email-adress and more, and if he needs to correct some fields, I'd
like to display the form again with all correct values filled in and the
incorrect fields hightlighted.

To make it a bit more difficult I've decided to POST to another file
(post.php) which validates the information and redirects the user (with
Header - Location) to page1.php if he has to correct the errors. If the form
is correctly filled in then he will be redirected to page2.php. This is to
prevent the browser for asking him if he wants to repost data if he hits
'Refresh'. Now I want to know how to pass information from post.php to
page1.php since the form page (page1) needs to know what was incorrect and
what was correct so that it can hightlight the bad fields. I don't want to
stick it in the URL since it would be too ugly, but I do have session
variables I can stick them in. Is this the way to go? Or is there a better
solution?

I guess many of you have fought with this before so I know you can help me
;)

Thanks in advance,
Victor

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

 > I want to validate a form (in page1.php) to check if the 
 > user has entered a correct email-adress and more, and if he 
 > needs to correct some fields, I'd like to display the form 
 > again with all correct values filled in and the incorrect 
 > fields hightlighted.

I tend to do this sort of thing using includes and a single page.  If
it's the first time being loaded (no post data) then just display the
form.  If it's been submitted then process the data and decide what to
do from there.  If there are errors, redisplay the form showing errors
that need to be corrected.  If there's no errors, move along to the next
stage in the process.

 > To make it a bit more difficult I've decided to POST to another file
 > (post.php) which validates the information and redirects the 
 > user (with Header - Location) to page1.php if he has to 
 > correct the errors. If the form is correctly filled in then 
 > he will be redirected to page2.php. This is to prevent the 
 > browser for asking him if he wants to repost data if he hits 
 > 'Refresh'.

That's a browser decision based on the existence of post data - in other
words, just because the form posts to a different file doesn't mean that
if you hit reload it won't re-post the data.

 > hightlight the bad fields. I don't want to stick it in the 
 > URL since it would be too ugly, but I do have session 
 > variables I can stick them in. Is this the way to go? Or is 
 > there a better solution?

There are ways to do it - cookies or hidden forms spring to mind - but
first it's worth working out if the effort is worth it.  It won't
prevent a page refresh from re-posting data (although you could test for
that in your php and deal with it accordingly).

CYA, Dave


--- End Message ---
--- Begin Message ---
I know it is probably something obvious but the following gives me a parse error and as a newbie I am having trouble locating it.
 
$query = "select * from news WHERE id = "$_get['id']"";
 
--- End Message ---
--- Begin Message ---
$query = "select * from news WHERE id = "$_get['id']"";
 
you've got quotes within quotes - either change the inner quotes to single
quotes, or escape them
 
$query = "select * from news WHERE id = '$_get[id]'";
or
$query = "select * from news WHERE id = \"$_get['id']\"";
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 27, 2002 3:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Parse Error(Newbie)


I know it is probably something obvious but the following gives me a parse
error and as a newbie I am having trouble locating it.
 
$query = "select * from news WHERE id = "$_get['id']"";
 
JJ Harrison
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
www.tececo.com <http://www.tececo.com> 
--- End Message ---
--- Begin Message ---
can you show us the lines above that line? say the previous 2 lines?.. also
depending on what server your on you might want to try

$query = "SELECT * FROM news WHERE id = "$_get['id']"";

but that line is ok ... with parse errors it's often, well i've found this
any way, that it's the line above the line the message says it is..
  -----Original Message-----
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
  Sent: Monday, 27 May 2002 3:47 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Parse Error(Newbie)


  I know it is probably something obvious but the following gives me a parse
error and as a newbie I am having trouble locating it.

  $query = "select * from news WHERE id = "$_get['id']"";

  JJ Harrison
  [EMAIL PROTECTED]
  www.tececo.com
--- End Message ---
--- Begin Message ---
In article <003601c20541$fdc31970$0100a8c0@JohnH>, [EMAIL PROTECTED] 
says...
> I know it is probably something obvious but the following gives me a parse error and 
>as a newbie I am having trouble locating it.
> 
> $query = "select * from news WHERE id = "$_get['id']"";
> 
> JJ Harrison
> [EMAIL PROTECTED]
> www.tececo.com
> 

$query = "select * from news WHERE id = " .$_get['id'];

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---

-----Original Message-----
I know it is probably something obvious but the following gives me a
parse error and as a newbie I am having trouble locating it.

$query = "select * from news WHERE id = "$_get['id']"";
-----Original Message-----

Any time you end up with two " characters together is a pretty good
indication of where you problem is.

You might try this:

$query = "SELECT * FROM news WHERE ID = '" . $_get['id'] . "'";

Alternately, and depending on what you're doing and why, it might be
more effective to do this:

$idstring = $_get['id'];
$query = "SELECT * FROM news WHERE ID = '$idstring'";

Your choice...

CYA, Dave


--- End Message ---
--- Begin Message ---
On Mon, 27 May 2002 [EMAIL PROTECTED] wrote:
> I know it is probably something obvious but the following gives me a
> parse error and as a newbie I am having trouble locating it.
> 
> $query = "select * from news WHERE id = "$_get['id']"";

A lot of people have answered this already, but just for a little more 
clarification, consider this: 

The reason the computer requires you to surround a string with quotes is 
so that it knows where the string begins and ends.

If you put quotes in the middle of the string, it thinks those mark the 
end; why would it think otherwise, since that's what quotes are for.

So people have provided you with various solutions for this. Each of them 
involve in some way indicating more specifically what's going on. Either 
you use a different kind of quotes (if you started the string with single 
quotes, it will let you put double quotes inside it without getting 
confused, and vice versa), or you use the backslash character before 
internal quotes. Backslash is the "escape" character which in this case 
tells the parser to ignore the special meaning of the quote that follows. 
So your line could have been written in any of the following ways:

  $query = "select * from news WHERE id = '{$_get['id']}'";
  $query = "select * from news WHERE id = \"{$_get['id']}\"";
  $query = 'select * from news WHERE id = "' . $_get['id'] . '"';

miguel

--- End Message ---
--- Begin Message ---
Hi to all;

Finally i've set-up my AIX server with PHP and oracle support. Thanks for
all who helps me for the configure setup.
Now I have a problem in oracle function regarding the retrieval of entries
in the oracle table. The Ora_Fetch_Into function doesnt work properly to me
or i have  an error in which i dont know. I've written below the code that i
used to test, it doesnt echo the value of $name and $email. My query works
if i've enter it manually with my Oracle server. I really dont know why im
just a newbie with this database(oracle) statement.

Please help us here. Thanks in advance.

<?PutEnv("ORACLE_SID=PROD");
PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod");
$connection = Ora_Logon("apps","apps");
$cursor= Ora_Open($connection);

$query = "select * from mikecarel";
$result = Ora_Parse($cursor,$query);
$result=Ora_Exec($cursor);
echo"<table border=1>";
echo"<tr><td><b>Full Name</b></td><td><b>Email Address</b></td></tr>";
while(Ora_Fetch_Into($cursor,$values)){
        $name = $values[0];
        $email = $values[1];
echo "<tr><td>$name</td><td>$email</td></tr>";
}
ora_close($cursor);
ora_logoff($connection); ?>







Regards,
mike

--- End Message ---
--- Begin Message ---
Check the return values from your ora_logon, ora_open, ora_parse, and 
ora_exec calls to see whether they worked. That way you can know at 
which stage it stopped working.

miguel

On Mon, 27 May 2002, Michael P. Carel wrote:
> Finally i've set-up my AIX server with PHP and oracle support. Thanks for
> all who helps me for the configure setup.
> Now I have a problem in oracle function regarding the retrieval of entries
> in the oracle table. The Ora_Fetch_Into function doesnt work properly to me
> or i have  an error in which i dont know. I've written below the code that i
> used to test, it doesnt echo the value of $name and $email. My query works
> if i've enter it manually with my Oracle server. I really dont know why im
> just a newbie with this database(oracle) statement.
> 
> Please help us here. Thanks in advance.
> 
> <?PutEnv("ORACLE_SID=PROD");
> PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod");
> $connection = Ora_Logon("apps","apps");
> $cursor= Ora_Open($connection);
> 
> $query = "select * from mikecarel";
> $result = Ora_Parse($cursor,$query);
> $result=Ora_Exec($cursor);
> echo"<table border=1>";
> echo"<tr><td><b>Full Name</b></td><td><b>Email Address</b></td></tr>";
> while(Ora_Fetch_Into($cursor,$values)){
>         $name = $values[0];
>         $email = $values[1];
> echo "<tr><td>$name</td><td>$email</td></tr>";
> }
> ora_close($cursor);
> ora_logoff($connection); ?>
> 
> 
> 
> 
> 
> 
> 
> Regards,
> mike
> 
> 
> 

--- End Message ---
--- Begin Message ---
thanks miguel but i've already checked it, i've included return values
checking where it stop. Here's my full source test script.
There where no Ora_Error_Code returned.

<?
PutEnv("ORACLE_SID=PROD");
PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod");
$connection = Ora_Logon("apps","apps");
if($connection==false){
        echo Ora_ErrorCode($connection).":". Ora_Error($connection)."<BR>";
exit;
}
$cursor= Ora_Open($connection);
if($cursor==false){
        echo Ora_ErrorCode($connection).":". Ora_Error($connection)."<BR>";
exit;
}
$query = "select * from mikecarel";
//$query = "select table_name from all_tables";
$result = Ora_Parse($cursor,$query);
if($result==false){
        echo Ora_ErrorCode($connection).":". Ora_Error($connection)."<BR>";
exit;
}
$result=Ora_Exec($cursor);
if($result==false){
        echo Ora_ErrorCode($connection).":". Ora_Error($connection)."<BR>";
exit;
}
echo"<table border=1>";
echo"<tr><td><b>Full Name</b></td><td><b>Email Address</b></td></tr>";
//$values=array(mike, tess);
while(Ora_Fetch_Into($cursor,$values)){
        $name = $values[0];
        $email = $values[1];
echo "<tr><td>$name</td><td>$email</td></tr>";
echo "$email";
print($name);
$result =1;
}
if(!$result==1) print("no result");
echo"</table>";

ora_close($cursor);
ora_logoff($connection);
?>


mike



> Check the return values from your ora_logon, ora_open, ora_parse, and
> ora_exec calls to see whether they worked. That way you can know at
> which stage it stopped working.
>
> miguel
>
> On Mon, 27 May 2002, Michael P. Carel wrote:
> > Finally i've set-up my AIX server with PHP and oracle support. Thanks
for
> > all who helps me for the configure setup.
> > Now I have a problem in oracle function regarding the retrieval of
entries
> > in the oracle table. The Ora_Fetch_Into function doesnt work properly to
me
> > or i have  an error in which i dont know. I've written below the code
that i
> > used to test, it doesnt echo the value of $name and $email. My query
works
> > if i've enter it manually with my Oracle server. I really dont know why
im
> > just a newbie with this database(oracle) statement.
> >
> > Please help us here. Thanks in advance.
> >
> > <?PutEnv("ORACLE_SID=PROD");
> > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod");
> > $connection = Ora_Logon("apps","apps");
> > $cursor= Ora_Open($connection);
> >
> > $query = "select * from mikecarel";
> > $result = Ora_Parse($cursor,$query);
> > $result=Ora_Exec($cursor);
> > echo"<table border=1>";
> > echo"<tr><td><b>Full Name</b></td><td><b>Email Address</b></td></tr>";
> > while(Ora_Fetch_Into($cursor,$values)){
> >         $name = $values[0];
> >         $email = $values[1];
> > echo "<tr><td>$name</td><td>$email</td></tr>";
> > }
> > ora_close($cursor);
> > ora_logoff($connection); ?>
> >
> >
> >
> >
> >
> >
> >
> > Regards,
> > mike
> >
> >
> >

--- End Message ---
--- Begin Message ---
have you tried compiling php with oci again,
by installing the Oracle8i Client libraries?
Should work as far as i have read.
The oci interface is much better than the ora
interface. And I am not familiar with the
ora functions, only used to oci.

Michael

"Michael P. Carel" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
000f01c20542$77bf4780$[EMAIL PROTECTED]">news:000f01c20542$77bf4780$[EMAIL PROTECTED]...
> Hi to all;
>
> Finally i've set-up my AIX server with PHP and oracle support. Thanks for
> all who helps me for the configure setup.
> Now I have a problem in oracle function regarding the retrieval of entries
> in the oracle table. The Ora_Fetch_Into function doesnt work properly to
me
> or i have  an error in which i dont know. I've written below the code that
i
> used to test, it doesnt echo the value of $name and $email. My query works
> if i've enter it manually with my Oracle server. I really dont know why im
> just a newbie with this database(oracle) statement.
>
> Please help us here. Thanks in advance.
>
> <?PutEnv("ORACLE_SID=PROD");
> PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod");
> $connection = Ora_Logon("apps","apps");
> $cursor= Ora_Open($connection);
>
> $query = "select * from mikecarel";
> $result = Ora_Parse($cursor,$query);
> $result=Ora_Exec($cursor);
> echo"<table border=1>";
> echo"<tr><td><b>Full Name</b></td><td><b>Email Address</b></td></tr>";
> while(Ora_Fetch_Into($cursor,$values)){
>         $name = $values[0];
>         $email = $values[1];
> echo "<tr><td>$name</td><td>$email</td></tr>";
> }
> ora_close($cursor);
> ora_logoff($connection); ?>
>
>
>
>
>
>
>
> Regards,
> mike
>


--- End Message ---
--- Begin Message ---
I've recently found out that the Ora_Fetch_Into function  cannot get a small
value of the tables data. We've tried to fetch other tables which have a
large amount data ,and it succeeds. The queried values echoed successfully.
Is there any idea why? im using PHP4.2.1 oracle7.3.3


Regards,
Mike





> thanks miguel but i've already checked it, i've included return values
> checking where it stop. Here's my full source test script.
> There where no Ora_Error_Code returned.
>
> <?
> PutEnv("ORACLE_SID=PROD");
> PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod");
> $connection = Ora_Logon("apps","apps");
> if($connection==false){
>         echo Ora_ErrorCode($connection).":".
Ora_Error($connection)."<BR>";
> exit;
> }
> $cursor= Ora_Open($connection);
> if($cursor==false){
>         echo Ora_ErrorCode($connection).":".
Ora_Error($connection)."<BR>";
> exit;
> }
> $query = "select * from mikecarel";
> //$query = "select table_name from all_tables";
> $result = Ora_Parse($cursor,$query);
> if($result==false){
>         echo Ora_ErrorCode($connection).":".
Ora_Error($connection)."<BR>";
> exit;
> }
> $result=Ora_Exec($cursor);
> if($result==false){
>         echo Ora_ErrorCode($connection).":".
Ora_Error($connection)."<BR>";
> exit;
> }
> echo"<table border=1>";
> echo"<tr><td><b>Full Name</b></td><td><b>Email Address</b></td></tr>";
> //$values=array(mike, tess);
> while(Ora_Fetch_Into($cursor,$values)){
>         $name = $values[0];
>         $email = $values[1];
> echo "<tr><td>$name</td><td>$email</td></tr>";
> echo "$email";
> print($name);
> $result =1;
> }
> if(!$result==1) print("no result");
> echo"</table>";
>
> ora_close($cursor);
> ora_logoff($connection);
> ?>
>
>
> mike
>
>
>
> > Check the return values from your ora_logon, ora_open, ora_parse, and
> > ora_exec calls to see whether they worked. That way you can know at
> > which stage it stopped working.
> >
> > miguel
> >
> > On Mon, 27 May 2002, Michael P. Carel wrote:
> > > Finally i've set-up my AIX server with PHP and oracle support. Thanks
> for
> > > all who helps me for the configure setup.
> > > Now I have a problem in oracle function regarding the retrieval of
> entries
> > > in the oracle table. The Ora_Fetch_Into function doesnt work properly
to
> me
> > > or i have  an error in which i dont know. I've written below the code
> that i
> > > used to test, it doesnt echo the value of $name and $email. My query
> works
> > > if i've enter it manually with my Oracle server. I really dont know
why
> im
> > > just a newbie with this database(oracle) statement.
> > >
> > > Please help us here. Thanks in advance.
> > >
> > > <?PutEnv("ORACLE_SID=PROD");
> > > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod");
> > > $connection = Ora_Logon("apps","apps");
> > > $cursor= Ora_Open($connection);
> > >
> > > $query = "select * from mikecarel";
> > > $result = Ora_Parse($cursor,$query);
> > > $result=Ora_Exec($cursor);
> > > echo"<table border=1>";
> > > echo"<tr><td><b>Full Name</b></td><td><b>Email Address</b></td></tr>";
> > > while(Ora_Fetch_Into($cursor,$values)){
> > >         $name = $values[0];
> > >         $email = $values[1];
> > > echo "<tr><td>$name</td><td>$email</td></tr>";
> > > }
> > > ora_close($cursor);
> > > ora_logoff($connection); ?>
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Regards,
> > > mike
> > >
> > >
> > >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
On Saturday 25 May 2002 04:26, Miguel Cruz wrote:
> On Sat, 25 May 2002, Jason Wong wrote:
> > Your biggest problem is that you're trying to nest mysql_query() but
> > you're only using 1 link identifier. You need to establish another
> > connection using another mysql_connect().
>
> The same link identifier can be used simultaneously for any number of
> queries so long as they are directed at the same server and rely on the
> same user credentials. You can query different databases, etc., on the
> same server with the same link identifier, for instance.

I'll take your word for it :) 

In my early encounters with php I had problems with multiple queries on a 
single page which were apparently solved by using more than one link-id. Ever 
since, I've been using more than one link-id when I have nesting or 
'over-lapping' queries.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Carson's Consolation:
        Nothing is ever a complete failure.
        It can always be used as a bad example.
*/

--- End Message ---
--- Begin Message ---
On Saturday 25 May 2002 05:21, Jeff Field wrote:
> Anyone know how to declare globals in a function from an array?  The
> following doesn't seem to work:
>
> foreach($_POST as $key => $value)
>     global $form_var[$key];

Not sure what you're trying to do. If you're trying to extract all the values 
in $_POST so that they're available in the global scope then try:

  foreach($_POST as $key => $value)
    $GLOBALS[$key] = $value;
  }

also look at extract().

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
A fail-safe circuit will destroy others.
                -- Klipstein
*/

--- End Message ---
--- Begin Message ---
look here:
http://www.php.net/manual/en/ref.filesystem.php

and especially here:
http://www.php.net/manual/en/function.filemtime.php

Michael

"Rui Huang" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]...
> Hi, friends,
>
> I want to display the last updated time of a file using php,
> but I don't know which function I should use. It seems that
> the date() just show the current time.
>
> For html file, a simple javascript works well, but in php files
> that script works weired. How to solve that problem?
>
> Thanks a lot.
>
>
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>


--- End Message ---

Reply via email to