[PHP] Re: Installed 5.2.6 but phpinfo() still says 5.0.2

2008-07-04 Thread Colin Guthrie

x0ml wrote:
I've installed PHP version 5.2.6 but phpinfo() and php -v both report back 
the old version 5.0.2.  I even copied php.ini-dist from the distribution to 
/etc/php.ini and restarted the physical server.  It still does show version 
5.2.6 as the current version.


As a sidenote, I'm having the same thing occur with my Apache upgrade that I 
just did too.  It still thinks its version 2.0.54 instead of version 2.0.63. 
I tweaked my httpd.conf file, didn't make any difference.


I'm running Fedora 2.6.11-1.1369_FC4.  Any ideas where to look?


We'll need details on *how* you installed it. I'm guessing you did it 
from source and did a simple ./configure && make && su make install right?


This is probably a BAD way to go on a system that controls things with 
packages, far better to upgrade the package (which is just as 
simply/difficult as compiling source really - well slightly more complex 
but not much!).


If you just did ./configure with out specifying --prefix it will defautl 
to /usr/local as an install path. Can you run /usr/local/bin/php -v ?


Col


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



[PHP] No Database Connection possible (mySQL)

2008-07-04 Thread Aviation Coding
Hi all,

I am having problems with a connection to a mysql database.

I am using


function con()
{
mysql_connect("localhost","user","pass") or die(mysql_error());
mysql_select_db("tava") or die(mysql_error());
}


Now, when I call the _function_ (!)

con() or die("no con");

I get the "no con" output.

When I call the mysql_connect and mysql_select directly before executing a
query, I get some DB output. But that won't work when I am using the
function...

Any ideas would be greatly appreciated.

Cheers!

Chris


[PHP] FW: [SPAM] [PHP] No Database Connection possible (mySQL)

2008-07-04 Thread Chris Scott
> -Original Message-
> From: Aviation Coding [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 04, 2008 10:15 AM
> To: php-general@lists.php.net
> Subject: [SPAM] [PHP] No Database Connection possible (mySQL)
> Importance: Low
> 
> Hi all,
> 
> I am having problems with a connection to a mysql database.
> 
> I am using
> 
> 
> function con()
> {
> mysql_connect("localhost","user","pass") or die(mysql_error());
> mysql_select_db("tava") or die(mysql_error());
> }
> 
> 
> Now, when I call the _function_ (!)
> 
> con() or die("no con");
> 
> I get the "no con" output.
> 
> When I call the mysql_connect and mysql_select directly before
executing a
> query, I get some DB output. But that won't work when I am using the
> function...
> 
> Any ideas would be greatly appreciated.
> 
> Cheers!
> 
> Chris

It's a bit of a long shot but are you using variables in the function
which might be out of scope?

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



RE: [PHP] FW: [SPAM] [PHP] No Database Connection possible (mySQL)

2008-07-04 Thread Chris Haensel
 

-Original Message-
From: Chris Scott [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 04, 2008 11:41 AM
To: php-general@lists.php.net
Subject: [PHP] FW: [SPAM] [PHP] No Database Connection possible (mySQL)
Importance: Low

> -Original Message-
> From: Aviation Coding [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 04, 2008 10:15 AM
> To: php-general@lists.php.net
> Subject: [SPAM] [PHP] No Database Connection possible (mySQL)
> Importance: Low
> 
> Hi all,
> 
> I am having problems with a connection to a mysql database.
> 
> I am using
> 
> 
> function con()
> {
> mysql_connect("localhost","user","pass") or die(mysql_error());
> mysql_select_db("tava") or die(mysql_error());
> }
> 
> 
> Now, when I call the _function_ (!)
> 
> con() or die("no con");
> 
> I get the "no con" output.
> 
> When I call the mysql_connect and mysql_select directly before
executing a
> query, I get some DB output. But that won't work when I am using the
> function...
> 
> Any ideas would be greatly appreciated.
> 
> Cheers!
> 
> Chris

It's a bit of a long shot but are you using variables in the function
which might be out of scope?

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

Hi mate,

no, I am using no variables in the other function. The function goes like

con() or die("no con");
$query = "SELECT ";
and so on

and I always get "no con"...

Cheers!


Chris


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



[PHP] Re: Installed 5.2.6 but phpinfo() still says 5.0.2

2008-07-04 Thread David Robley
x0ml wrote:

> For some reason this first post didn't "post" to this newsgroup...
> 
> 
> "x0ml" <[EMAIL PROTECTED]> wrote in message news:...
>> I've installed PHP version 5.2.6 but phpinfo() and php -v both report
>> back
>> the old version 5.0.2.  I even copied php.ini-dist from the distribution
>> to /etc/php.ini and restarted the physical server.  It still does show
>> version 5.2.6 as the current version.
>>
>> As a sidenote, I'm having the same thing occur with my Apache upgrade
>> that
>> I just did too.  It still thinks its version 2.0.54 instead of version
>> 2.0.63. I tweaked my httpd.conf file, didn't make any difference.
>>
>> I'm running Fedora 2.6.11-1.1369_FC4.  Any ideas where to look?
>>
>> Mark
>>
>>
You did restart the server after making the changes?



Cheers
-- 
David Robley

Push the limit, and the limit will move away!
Today is Setting Orange, the 39th day of Confusion in the YOLD 3174. 


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



[PHP] Re: No Database Connection possible (mySQL)

2008-07-04 Thread David Robley
Aviation Coding wrote:

> Hi all,
> 
> I am having problems with a connection to a mysql database.
> 
> I am using
> 
> 
> function con()
> {
> mysql_connect("localhost","user","pass") or die(mysql_error());
> mysql_select_db("tava") or die(mysql_error());
> }
> 
> 
> Now, when I call the _function_ (!)
> 
> con() or die("no con");
> 
> I get the "no con" output.
> 
> When I call the mysql_connect and mysql_select directly before executing a
> query, I get some DB output. But that won't work when I am using the
> function...
> 
> Any ideas would be greatly appreciated.
> 
> Cheers!
> 
> Chris

I think you need to return something from the function, like true if the
connection/select worked, false if not.



Cheers
-- 
David Robley

If I were two faced, would I wear this one?
Today is Setting Orange, the 39th day of Confusion in the YOLD 3174. 


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



[PHP] Convert PDF Files to PCL-Files

2008-07-04 Thread jogisarge

Hello @all,

i am running php5 on a IBM i5 V5R4.
now i have to print exisiting pdf-files.

the problem is, i cant use external programms like pdftops or other stuff
like this, because the php core runs in the pase environment.

is there any possibility to convert existing pdfs to pcl files ?

bye jo




-- 
View this message in context: 
http://www.nabble.com/Convert-PDF-Files-to-PCL-Files-tp18280322p18280322.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



[PHP] Creating XML files

2008-07-04 Thread It flance
Hi all,

Some months ago i worked with XML. And i remember that i was able to create xml 
files quite easily. Now i don`t have the book i used by the time. I made many 
searches in google and i don't find something interesting. So i'm wondering if 
somebody can give a good link with examples. If i remeber well, i can create 
axml file without writing the hole file to a string before writing the string 
to the file.

Thanks a lot


  


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



[PHP] Re: No Database Connection possible (mySQL)

2008-07-04 Thread M. Sokolewicz

David Robley wrote:

Aviation Coding wrote:


Hi all,

I am having problems with a connection to a mysql database.

I am using


function con()
{
mysql_connect("localhost","user","pass") or die(mysql_error());
mysql_select_db("tava") or die(mysql_error());
}


Now, when I call the _function_ (!)

con() or die("no con");

I get the "no con" output.

When I call the mysql_connect and mysql_select directly before executing a
query, I get some DB output. But that won't work when I am using the
function...

Any ideas would be greatly appreciated.

Cheers!

Chris


I think you need to return something from the function, like true if the
connection/select worked, false if not.



Cheers

You are correct.

function foo() {
 // does something
}

var_dump(foo()); // returns NULL

why? because you don't explicitly return anything. If you did, that'd be 
the return value. So if you did:

function bar() {
   // does something
   return true;
}

var_dump(bar()); // return true

Now, your script assumes a return-value:
baz() or somethingElse();
is an expression. This basically says:
if(!baz()) {
   somethingElse();
}

Now, return (implicitly) null will result in (trough lazy comparison) a 
false value (*null == false*, null !== false), which then triggers your 
die() condition. Returning a meaningful value will get rid of that.


Other than that, choose 1 of 2 techniques:
1. error out inside the function itself (like you do now)
OR
2. error out based on the return-value of the function (like you do now 
ASWELL)

don't combine 1 and 2, stick with either, but not both.

function con()
{
mysql_connect("localhost","user","pass") or die(mysql_error());
mysql_select_db("tava") or die(mysql_error());
}
con();

works. The following would work too:
function con()
{
$r = mysql_connect("localhost","user","pass");
if(!$r) {
   return false;
}
$r2 = mysql_select_db("tava");
if(!$r2) {
   return false;
}
return true;
}

con() or die('no conn');

would also work correctly. So, stick with either, don't mix em.

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



[PHP] Re: Hi,

2008-07-04 Thread Shawn McKenzie

John Jairo Vega Angulo wrote:

Hi,
  How are u doing these days?Yesterday I found a web of a large trading
company from china,which is an agent of all the well-known digital product
factories,and facing to both wholesalers,retailsalers,and personal customer
all over the world. They export all kinds of digital products and offer most
competitive and reasonable price and high quality goods for our clients,so i
think we you make a big profit if we do business with them.And they promise
they will provide the best after-sales-service.In my opinion we can make a
trial order to test that. Look forward to your early reply!
 The Web address:http://www.mwhdy.com/


Hi John Jairo Vega Angulo,

I'm doing well.  Wow!  That's truly awesome!  I'm all about promises, 
let's do a trial order!


Happy Independence Day!
-Shawn

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



[PHP] Scrambling a word

2008-07-04 Thread Ron Piggott
I am using PHP 4

I am trying to figure out how to scramble a word.  

Example: hello so the output might be elolh

Any ideas?

Ron


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



Re: [PHP] Scrambling a word

2008-07-04 Thread Michael S. Dunsavage
On Fri, 2008-07-04 at 18:52 -0400, Ron Piggott wrote:
> I am using PHP 4
> 
> I am trying to figure out how to scramble a word.  
> 
> Example: hello so the output might be elolh
> 
> Any ideas?
> 
> Ron
> 
> 

http://koivi.com/letter-scramble/
-- 
Michael S. Dunsavage


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



Re: [PHP] Scrambling a word

2008-07-04 Thread Stefano Esposito
On Fri, 04 Jul 2008 18:52:49 -0400
Ron Piggott <[EMAIL PROTECTED]> wrote:

> I am using PHP 4
> 
> I am trying to figure out how to scramble a word.  
> 
> Example: hello so the output might be elolh
> 
> Any ideas?
> 
> Ron
> 
> 

str_shuffle()
 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Vieni nei Riccione Family Hotels! Ti aspettano servizi per bambini, ampi spazi 
per il gioco e tanto divertimento! Prenota subito on-line la tua vacanza!
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=8058&d=5-7

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



Re: [PHP] Scrambling a word

2008-07-04 Thread Ron Piggott

Is there a way to output the results with a space between each
character?

$shuffled = str_shuffle($str);

On Sat, 2008-07-05 at 01:20 +0200, Stefano Esposito wrote:
> On Fri, 04 Jul 2008 18:52:49 -0400
> Ron Piggott <[EMAIL PROTECTED]> wrote:
> 
> > I am using PHP 4
> > 
> > I am trying to figure out how to scramble a word.  
> > 
> > Example: hello so the output might be elolh
> > 
> > Any ideas?
> > 
> > Ron
> > 
> > 
> 
> str_shuffle()
>  
> 
>  --
>  Email.it, the professional e-mail, gratis per te: http://www.email.it/f
>  
>  Sponsor:
>  Vieni nei Riccione Family Hotels! Ti aspettano servizi per bambini, ampi 
> spazi per il gioco e tanto divertimento! Prenota subito on-line la tua 
> vacanza!
>  Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=8058&d=5-7


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



[PHP] Trying to keep a dropdown selection sticky

2008-07-04 Thread Michael S. Dunsavage
I have a form I want to keep sticky, but I can't figure out how. I got
all the 's to be sticky

The select script


State';
echo '';
foreach ($state_list as $key => $value) {
echo " $value\n";
}
echo '';
echo '';



?>


so now how do I keep that sticky?

-- 
Michael S. Dunsavage


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



Re: [PHP] Convert PDF Files to PCL-Files

2008-07-04 Thread Ray Hauge

jogisarge wrote:

Hello @all,

i am running php5 on a IBM i5 V5R4.
now i have to print exisiting pdf-files.

the problem is, i cant use external programms like pdftops or other stuff
like this, because the php core runs in the pase environment.

is there any possibility to convert existing pdfs to pcl files ?

bye jo






I don't know if IBM has a port of the linux command pdf2ps (to post 
script).  There should be some sort of converter from post script to 
PCL, but I'm not completely sure on that.  I'm not currently aware of a 
straight converter.  Sorry if that's not much of a help.


--
Ray Hauge
www.primateapplications.com

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