php-general Digest 4 Jul 2008 08:40:11 -0000 Issue 5549

2008-07-04 Thread php-general-digest-help

php-general Digest 4 Jul 2008 08:40:11 - Issue 5549

Topics (messages 276256 through 276278):

Re: PHPExcel
276256 by: David Giragosian
276257 by: Boyd, Todd M.
276258 by: Dan Shirah
276259 by: Robert Cummings
276260 by: Dan Shirah
276261 by: Dan Shirah
276263 by: Richard Heyes
276264 by: Richard Heyes
276265 by: Richard Heyes
276266 by: Mario Guenterberg
276267 by: Dan Shirah
276270 by: Shawn McKenzie
276271 by: Shawn McKenzie
276272 by: Jim Lucas
276273 by: Jim Lucas

Re: Inspiration for a Tombstone.
276262 by: Dotan Cohen

PHP 5 Web Developer Position in Mountain View, CA
276268 by: Abby Knight

[confirm: ffd06320e87b4e72f197eae8dfdde17a [EMAIL PROTECTED]
276269 by: axis

Installed 5.2.6 but phpinfo() still says 5.0.2
276274 by: x0ml
276275 by: x0ml
276276 by: Shawn McKenzie
276278 by: Colin Guthrie

Static Member Overloading
276277 by: Ryan Panning

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]


--
---BeginMessage---
On 7/3/08, Shawn McKenzie [EMAIL PROTECTED] wrote:

 Richard Heyes wrote:

  Happy 4th of July!


 How did you know it was my sisters birthday today? Been an exciting
 week, first Canada's birthday was on Monday, now my sister's birthday
 today. What a thrill ride.


 Isn't it the 3rd?

 It is in the great Republic of Texas.

 -Shawn


It is even in the sub-tropical part of Texas known as Houston.

But this isn't a day of celebration for you guys, Richard, to be sure.

Do you all just ignore the day, or do you hold some kind of
anti-celebration?

David
---End Message---
---BeginMessage---
 -Original Message-
 From: David Giragosian [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 03, 2008 11:19 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] PHPExcel
 
 On 7/3/08, Shawn McKenzie [EMAIL PROTECTED] wrote:
 
  Richard Heyes wrote:
 
   Happy 4th of July!
 
 
  How did you know it was my sisters birthday today? Been an exciting
  week, first Canada's birthday was on Monday, now my sister's
 birthday
  today. What a thrill ride.
 
 
  Isn't it the 3rd?
 
  It is in the great Republic of Texas.
 
 
 It is even in the sub-tropical part of Texas known as Houston.
 
 But this isn't a day of celebration for you guys, Richard, to be sure.
 
 Do you all just ignore the day, or do you hold some kind of
 anti-celebration?

Heh... almost got in trouble at work for laughing so loud at that one. Vive le 
revolucion!


Todd Boyd
Web Programmer



---End Message---
---BeginMessage---
So how would I go about getting each result from my query into the
columns/rows?

Should I do my query, and then assign the first column to an array, the
second to another array, etc?

And then try to loop it using $i to count each row?

And just FYI, I put Happy 4th (even though today is the 3rd) because I won't
be checking my email tomorrow :)
---End Message---
---BeginMessage---
On Thu, 2008-07-03 at 16:36 +0100, Richard Heyes wrote:
  Happy 4th of July!
  
  How did you know it was my sisters birthday today? Been an exciting
  week, first Canada's birthday was on Monday, now my sister's birthday
  today. What a thrill ride.
 
 Isn't it the 3rd?

*doh* I took for granted someone else had the date right... I rarely
know what day it is :)

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP

---End Message---
---BeginMessage---
GOT IT!!!

I changed my code to the following:


$sql = SELECT * FROM brev_pending_summary_detail WHERE name =
'$name_code';
 if (!empty($case_age)) {
  $sql.= AND case_age_group = '$case_age';
 }
 if (!empty($case_cat)) {
  $sql.= AND case_category = '$case_cat';
 }
 if (!empty($case_status)) {
  $sql.= AND case_status = '$case_status';
 } // Start our query of the database
$query = ifx_query($sql, $connect_id);
$row = ifx_fetch_row($query);
$results = array();

echo date('H:i:s') .  Add some databr /\n;

for ($i = 3, $j = 0; $i = $count; $i++, $j++) {
 $results[$j] = ifx_fetch_row($query);

 $objPHPExcel-getActiveSheet()-setCellValue('A' . $i,
$results[$j]['stat_year']);
 $objPHPExcel-getActiveSheet()-setCellValue('B' . $i,
$results[$j]['stat_month']);
 $objPHPExcel-getActiveSheet()-setCellValue('C' . $i,
$results[$j]['name']);
 $objPHPExcel-getActiveSheet()-setCellValue('D' . $i,
$results[$j]['case_age_group']);
 }



I created a seperate query to get the row count...created an empty array (
$results = array(); )

I set $i = 3 so my results will start printing on line 3 of the spreadsheet

I set $j = 0 so the row data will start at the first row of the results from
my query

Then I made the loop repeat until $i became equal to the total number of
rows

And 

[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=8058d=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=8058d=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 INPUT's to be sticky

The select script


?php
echo 'strongState/strongbr';
echo 'select name=State';
foreach ($state_list as $key = $value) {
echo option value=\$key\ $value/option\n;
}
echo '/select';
echo 'br';



?


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