|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Sat Aug 18 2001 - 11:31:47 CDT
php-general Digest 18 Aug 2001 16:31:47 -0000 Issue 823
Topics (messages 63266 through 63288):
question from a php newbie
63266 by: 602e23
63269 by: Maxim Maletsky
Re: looong date formatting for MySQL
63267 by: Maxim Maletsky
Re: debugger_on() undefined?
63268 by: Matthew Loff
Re: History of the browser
63270 by: Maxim Maletsky
Re: Large sites that use PHP
63271 by: Tom Malone
ADODB Library
63272 by: Jochen Kaechelin
Problems with cookies....
63273 by: Marius Pertravèius
Help compiling CVS
63274 by: Evan Nemerson
Re: Large sites using PHP
63275 by: Maxim Maletsky
63282 by: pierre-yves
63283 by: Quentin Gillet
Search for PHP Motivation Studies
63276 by: Björn Schotte
SQL Highlighting in PHP?
63277 by: Chris Lambert
array_unique() and count issue
63278 by: CGI GUY
advantage of php
63279 by: nafiseh saberi
63280 by: pierre-yves
cgi 2 php
63281 by: Steven Dowd
63284 by: Jamie Burns
accents and postgresql
63285 by: Florian Blaser
63286 by: Martín Marqués
error: input in flex scanner failed
63287 by: PeterOblivion.aol.com
Overlaying text on jpegs
63288 by: Seb Frost
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
I'm so new to this, in fact, that I may not be able to
even frame my question correctly. Please bear with me.
Suppose that I had a list in a data base of, say, countries
and that I built an array as
$states = array (
array("abbr"=>"MA", "name"=>"Massachusetts"),
array("abbr"=>"NY", "name"=>"New York"),
array("abbr"=>"CA", "name"=>"California"),
[. . .]
)
is there a way to dump this array in a form which would allow
it to be written to an 'include' file. I tried both var_dump
and print_r but neither method seems to have worked correctly.
The actual array which I have in mind is much more complicated
structurally than the states array shown above, but it is
unlikely to change more than once a day so it seems wastefull
to probe the database each time a copy is needed.
av0-
attached mail follows:
You know, what you can do (strongly not recommended, but still) is to insert
that whole thing into a database and then pull this string out and pass it
through eval().
ie: eval($record);
another way would be to take all that, addslashes($it) and then write into a
file with stripslashes($it).
But, you are going to need that statement to be a string, not code.
Otherwise you can "read yourself", fread() your own file to take your code
as a string.
After all, those are kinda silly methods. I am sure you can find a better
solution for your needs. Storing codes is a very powerful but not always
necessary procedure.
Cheers,
Maxim Maletsky
www.PHPbeginner.com
-----Original Message-----
From: 602e23 [mailto:602e23
email.com]
Sent: Saturday, August 18, 2001 12:26 PM
To: php-general
lists.php.net
Subject: [PHP] question from a php newbie
I'm so new to this, in fact, that I may not be able to
even frame my question correctly. Please bear with me.
Suppose that I had a list in a data base of, say, countries
and that I built an array as
$states = array (
array("abbr"=>"MA", "name"=>"Massachusetts"),
array("abbr"=>"NY", "name"=>"New York"),
array("abbr"=>"CA", "name"=>"California"),
[. . .]
)
is there a way to dump this array in a form which would allow
it to be written to an 'include' file. I tried both var_dump
and print_r but neither method seems to have worked correctly.
The actual array which I have in mind is much more complicated
structurally than the states array shown above, but it is
unlikely to change more than once a day so it seems wastefull
to probe the database each time a copy is needed.
av0-
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Still, read this
php.net/date
it has a variety of functions, dates with zeros and without...
Another thing you can do is using the mySQL manual. Did you know that mySQL has a WHOLE BUNCH of date functions?
Cheers, Maxim Maletsky
-----Original Message-----
From: CGI GUY [mailto:cgi_guy1313
yahoo.com]
Sent: Saturday, August 18, 2001 8:30 AM
To: php-general
lists.php.net
Subject: Re: [PHP] looong date formatting for MySQL
Thanks for the reply, however, that function call doesn't zero-substitute (i.e., "07" for "7", "03" for "3", etc.); that's why I've added this:
if ($month < 10) { $month = "0"; $month .= $today['mon']; }
By default, MySQL only accepts dates as YYYY-MM-DD; PHP's getdate(Y-m-d) prints out YYYY-M-DD or YYYY-MM-DD IF AND ONLY IF the month is two-digit.
--- Adam Rambousek <rambousek
volny.cz> wrote:
> date("Y-m-d") should do the job
>
> > There's gotta be an easier way to get create a
> date
> > properly formatted for MySQL's standard YYYY-MM-DD
> > DATE field format. Any suggestions,
> > smacks-upside-the-head, etc. on how to reduce this
> > would be greatly appreciated.
>
>
>
> --
> Adam Rambousek
> email: rambousek
volny.cz ICQ: 47596279
> Jabber: rambousek
njs.netlab.cz
> www: http://adamovy.cestiny.cz
> http://hemzeni.poda.cz/matrix
> * I'll save you from yourself, From those demons of
> the night
> They promise fame and fortune, All that you
> eagerly desire. - Era
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe
lists.php.net
> For additional commands, e-mail:
> php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
__________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
PHP docs are weak on debugger_on() because the debugger isn't a feature in PHP 4 :)
It was not included in the transition from PHP 3 to 4. You'll have to use a 3rd-party debugger for PHP code. Search the archives for this list, it has been discussed in the past.
-----Original Message-----
From: Jeffery Cann [mailto:jeffery.cann
mridanga.com]
Sent: Friday, August 17, 2001 9:20 PM
To: php-general
lists.php.net
Subject: [PHP] debugger_on() undefined?
Greetings.
I am running php 4.0.6, which I built as an apache module on Linux 2.2.14. I am trying to get debug information, using the 'debugger_on()' function.
My compilation line (from phpinfo()) is:
'./configure' '--prefix=/usr/local/php' '--with-config-file-path=/etc' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-track-vars' '--enable-magic-quotes' '--enable-debugger' '--with-mysql=/usr/local/mysql' '--with-interbase=/opt/interbase'
However, when I execute a php script that includes the 'debugger_on()' function, I get:
Fatal error: Call to undefined function: debugger_on()
This would seem that although I said '--enable-debugger' in the configuration, my debugger is either: a) not working in php 4.0.6 or b)
not compiled into my code.
I appreciate any hints, suggestions, etc. The docs on php.net are rather weak on using the debugger_on() function.
Thanks Jeff
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
The last page browser visited and clicked on 'you' would be available in $HTTP_REFERER. But, as the whole history, you would need some javascript to do that. It should also be impossible to do due security reasons.
Cheers, Maxim Maletsky
-----Original Message-----
From: Ing. Raul Glez Rdguez [mailto:raul
mtz.jcce.org.cu]
Sent: Saturday, August 18, 2001 5:59 AM
To: php-general
lists.php.net
Subject: [PHP] History of the browser
Hi Php Users.
How can I get the items of a browser's history?
Thank you.
attached mail follows:
how about ScreamingMedia
Tom Malone Web Designer http://www.tom-malone.com
attached mail follows:
Anyone made good experiences with the ADODB Library for PHP4?
-- WA-P : Jochen Kaechelin Programmierung - Beratung - Hosting Stuttgarter Strasse 3, D-73033 Göppingen Tel. 07161 - 92 95 94, Fax 92 95 98
attached mail follows:
Sveiki, php-general,
I want to put cookies to know how I have to open window (new window or same window), but I'm making some mistake. Please help me.
Here is the code.... <? $pav='nustatymai.php'; if ( $nustatymaslangas == 1 ) { setcookie("nustlangas", 1, time()+3600*24*30); } else { setcookie("nustlangas", 0, time()+3600*24*30); } if ( $nustatymaspastas == 1 ) { setcookie("nustpastas", 1, time()+3600*24*30); } else { setcookie("nustpastas", 0, time()+3600*24*30); } if ( $jau == 1 ){ header("Location: main.htm"); exit; } ?>
<form action="<? echo $pav; ?>"> <input type="hidden" name="jau" value="1"> <SELECT name="nustatymaslangas"> <option value="#">--- Pasirinkite ---</option> <option value="0">Same Window</option> <option value="1">New Window</option> </select>
<SELECT name="nustatymaspastas"> <option value="#">--- Choose ---</option> <option value="0">Same Window</option> <option value="1">New Window</option> </select> <input type="submit" value="Submit"> </form>
____________________________
2001.08.18, ðeðtadienis
Marius Pertravèius
iCQ: #125733984
Lietuva
xxx.lt
attached mail follows:
lm -ldl -lnsl -lresolv -lcrypt stub.lo: file not recognized: File truncated collect2: ld returned 1 exit status make[1]: *** [libphp4.la] Error 1 make[1]: Leaving directory `/usr/local/cvs/php4' make: *** [all-recursive] Error 1
grrrrrrrrrrr.....
Any ideas? I have the latest stable version already installed, but when I try to build the CVS (I want to use PHP-GTK) it gives me that.
Thank in advance Evan
attached mail follows:
Dear PHP gurus:
I've been following here the ever-growing-never-to-be-stopped discussions related to the largest sites using PHP. Apparently, most of the PHP developers are trying to convince their bosses to use Open Source language PHP instead of other 'silly' commercial solutions those 'brains' have in mind.
It is just happened to me to be asked the same thing on a meeting with one of our clients. Therefore I have composed a dirty list of sites you all were posting during the time. I've done no research on this at all. My work consisted only in organizing your comments into one single resource.
The forwarded email below is what I came up with.
Please, who cares, update this list and perhaps even make it available to public online. Could be a good idea to have such resource running somewhere. I will definitely create a section for it on PHPBeginner.com and another portal I am planning to open soon. All of you are welcome to contribute and/or to reproduce it on your own sites.
Thanks all, hope it's helpful.
Regards, Maxim Maletsky
www.PHPBeginner.com
-----Original Message-----
From: Maxim Maletsky [mailto:maxim
maxim.cx]
Sent: Saturday, August 18, 2001 2:30 PM
To: Terrie *****
Subject: Large sites using PHP
Terrie, On the meeting we had last Thursday you asked me about the large sites that use PHP. I have composed a small list of such sites.
Here it goes:
www.sourceforge.net (30 millions pv/month)
www.audiogalaxy.com (Napster follow-up, dozens of millions per/month)
http://livebid.amazon.com (a part of Amazon.com, bet has a good traffic)
http://mp3.lycos.com (One of the largest MP3 search engines in the world by Lycos. Their traffic but must be measured in several dozens of millions pv/mon)
http://xoom.com (a huge online multi-service site. the #1 competitor to GeoCities)
www.capitalone.com (well known credit card company)
www.ecrush.com (14 million hits a month on avg)
www.bangable.com (4 million page views a month. All PHP/mySQL)
www.amdmb.com (uses MySQL and PHP for everything. 5 million pages/mon)
www.insight.com (is a publicly traded fortune 1000 company. The site is 90% PHP)
www.ig.com.br (the 3rd largest Brazilian portal)
www.goeureka.com.au/super.php (AltaVista in Australia)
www.kinderstart.com (Major children's portal. PHP and mySQL and some Perl.)
www.marketplayer.com (provides the real-time stock market simulations for sites like etrade.com and smartmoney.com that have these games)
www.dc.com (Deloitte Consulting)
www.dialpad.com (user registration and member backend is PHP driven)
www.thewb.com (uses PHP for the interactive areas such as message boards, polls, etc.)
also:
www.nbci.com www.sprint.ca www.ElectronicArts.com www.f2s.com www.indy500.com www.planetsourceocde.com www.easydns.com www.admworld.com www.communityconnect.com www.viant.com www.chek.com
Some say that also HP, IBM, and even Mr. Microsoft run "some" Apache/PHP servers (looking it up on Netcraft.com--use their OS vendors search)
Here is the link to a related discussion on PHP developers mailing list archive: http://marc.theaimsgroup.com/?t=99616558100011&w=4&r=1
** All this data was composed from the posts of respectable developers on the international PHP mailing list. **
Sincerely,
Maxim Maletsky Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
maxim
phpbeginner.com
www.phpbeginner.com
attached mail follows:
Dear PHP fans,
Knowing large sites that use php is one thing (it shows the language can support heavy loads). But what I would really like to know is the time difference to design, code and implement web application in PHP versus java solution, or ColdFusion, or another language.
I switch to PHP because I love the language but mainly because I could develop application about 30% faster than ASP. (the language I used before)
The staff I hire can learn PHP and be very productive within a few days, soory but I can't say the same for other language...
py
----- Original Message -----
From: "Maxim Maletsky" <php-general
phpbeginner.com>
To: "PHP" <php-general
lists.php.net>
Sent: Saturday, August 18, 2001 1:45 AM
Subject: [PHP] FW: Large sites using PHP
>
> Dear PHP gurus:
>
> I've been following here the ever-growing-never-to-be-stopped discussions
> related to the largest sites using PHP. Apparently, most of the PHP
> developers are trying to convince their bosses to use Open Source language
> PHP instead of other 'silly' commercial solutions those 'brains' have in
> mind.
>
> It is just happened to me to be asked the same thing on a meeting with one
> of our clients. Therefore I have composed a dirty list of sites you all
were
> posting during the time. I've done no research on this at all. My work
> consisted only in organizing your comments into one single resource.
>
> The forwarded email below is what I came up with.
>
> Please, who cares, update this list and perhaps even make it available to
> public online. Could be a good idea to have such resource running
somewhere.
> I will definitely create a section for it on PHPBeginner.com and another
> portal I am planning to open soon. All of you are welcome to contribute
> and/or to reproduce it on your own sites.
>
> Thanks all,
> hope it's helpful.
>
>
> Regards,
> Maxim Maletsky
>
> www.PHPBeginner.com
>
>
>
>
> -----Original Message-----
> From: Maxim Maletsky [mailto:maxim
maxim.cx]
> Sent: Saturday, August 18, 2001 2:30 PM
> To: Terrie *****
> Subject: Large sites using PHP
>
>
>
> Terrie,
> On the meeting we had last Thursday you asked me about the large sites
that
> use PHP. I have composed a small list of such sites.
>
> Here it goes:
>
>
>
> www.sourceforge.net (30 millions pv/month)
>
> www.audiogalaxy.com (Napster follow-up,
> dozens of millions per/month)
>
> http://livebid.amazon.com (a part of Amazon.com,
> bet has a good traffic)
>
> http://mp3.lycos.com (One of the largest MP3 search
> engines in the world by Lycos.
> Their traffic but must be
> measured in several dozens of
> millions pv/mon)
>
> http://xoom.com (a huge online multi-service site.
> the #1 competitor to GeoCities)
>
> www.capitalone.com (well known credit card company)
>
> www.ecrush.com (14 million hits a month on avg)
>
> www.bangable.com (4 million page views a month.
> All PHP/mySQL)
>
> www.amdmb.com (uses MySQL and PHP for
> everything. 5 million pages/mon)
>
> www.insight.com (is a publicly traded
> fortune 1000 company.
> The site is 90% PHP)
>
> www.ig.com.br (the 3rd largest Brazilian portal)
>
> www.goeureka.com.au/super.php (AltaVista in Australia)
>
> www.kinderstart.com (Major children's portal.
> PHP and mySQL and some Perl.)
>
> www.marketplayer.com (provides the real-time stock
> market simulations for sites like
> etrade.com and smartmoney.com
> that have these games)
>
> www.dc.com (Deloitte Consulting)
>
> www.dialpad.com (user registration and member
> backend is PHP driven)
>
> www.thewb.com (uses PHP for the interactive
> areas such as message boards,
> polls, etc.)
>
>
> also:
>
> www.nbci.com
> www.sprint.ca
> www.ElectronicArts.com
> www.f2s.com
> www.indy500.com
> www.planetsourceocde.com
> www.easydns.com
> www.admworld.com
> www.communityconnect.com
> www.viant.com
> www.chek.com
>
>
> Some say that also HP, IBM, and even Mr. Microsoft run "some" Apache/PHP
> servers (looking it up on Netcraft.com--use their OS vendors search)
>
> Here is the link to a related discussion on PHP developers mailing list
> archive:
> http://marc.theaimsgroup.com/?t=99616558100011&w=4&r=1
>
> **
> All this data was composed from the posts of respectable developers on the
> international PHP mailing list.
> **
>
>
> Sincerely,
>
> Maxim Maletsky
> Founder, Chief Developer
>
> PHPBeginner.com (Where PHP Begins)
> maxim
phpbeginner.com
> www.phpbeginner.com
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
I come from asp world, too, but I wouldn't say php is quicker to develop. Sometimes it can take longer.
But it's really worth it.
-----Message d'origine-----
De : pierre-yves [mailto:pylem
sympatico.ca]
Envoyé : samedi 18 août 2001 14:45
À : php-general
lists.php.net
Objet : Re: [PHP] FW: Large sites using PHP
Dear PHP fans,
Knowing large sites that use php is one thing (it shows the language can support heavy loads). But what I would really like to know is the time difference to design, code and implement web application in PHP versus java solution, or ColdFusion, or another language.
I switch to PHP because I love the language but mainly because I could develop application about 30% faster than ASP. (the language I used before)
The staff I hire can learn PHP and be very productive within a few days, soory but I can't say the same for other language...
py
----- Original Message -----
From: "Maxim Maletsky" <php-general
phpbeginner.com>
To: "PHP" <php-general
lists.php.net>
Sent: Saturday, August 18, 2001 1:45 AM
Subject: [PHP] FW: Large sites using PHP
>
> Dear PHP gurus:
>
> I've been following here the ever-growing-never-to-be-stopped discussions
> related to the largest sites using PHP. Apparently, most of the PHP
> developers are trying to convince their bosses to use Open Source language
> PHP instead of other 'silly' commercial solutions those 'brains' have in
> mind.
>
> It is just happened to me to be asked the same thing on a meeting with one
> of our clients. Therefore I have composed a dirty list of sites you all
were
> posting during the time. I've done no research on this at all. My work
> consisted only in organizing your comments into one single resource.
>
> The forwarded email below is what I came up with.
>
> Please, who cares, update this list and perhaps even make it available to
> public online. Could be a good idea to have such resource running
somewhere.
> I will definitely create a section for it on PHPBeginner.com and another
> portal I am planning to open soon. All of you are welcome to contribute
> and/or to reproduce it on your own sites.
>
> Thanks all,
> hope it's helpful.
>
>
> Regards,
> Maxim Maletsky
>
> www.PHPBeginner.com
>
>
>
>
> -----Original Message-----
> From: Maxim Maletsky [mailto:maxim
maxim.cx]
> Sent: Saturday, August 18, 2001 2:30 PM
> To: Terrie *****
> Subject: Large sites using PHP
>
>
>
> Terrie,
> On the meeting we had last Thursday you asked me about the large sites
that
> use PHP. I have composed a small list of such sites.
>
> Here it goes:
>
>
>
> www.sourceforge.net (30 millions pv/month)
>
> www.audiogalaxy.com (Napster follow-up,
> dozens of millions per/month)
>
> http://livebid.amazon.com (a part of Amazon.com,
> bet has a good traffic)
>
> http://mp3.lycos.com (One of the largest MP3 search
> engines in the world by Lycos.
> Their traffic but must be
> measured in several dozens of
> millions pv/mon)
>
> http://xoom.com (a huge online multi-service site.
> the #1 competitor to GeoCities)
>
> www.capitalone.com (well known credit card company)
>
> www.ecrush.com (14 million hits a month on avg)
>
> www.bangable.com (4 million page views a month.
> All PHP/mySQL)
>
> www.amdmb.com (uses MySQL and PHP for
> everything. 5 million pages/mon)
>
> www.insight.com (is a publicly traded
> fortune 1000 company.
> The site is 90% PHP)
>
> www.ig.com.br (the 3rd largest Brazilian portal)
>
> www.goeureka.com.au/super.php (AltaVista in Australia)
>
> www.kinderstart.com (Major children's portal.
> PHP and mySQL and some Perl.)
>
> www.marketplayer.com (provides the real-time stock
> market simulations for sites like
> etrade.com and smartmoney.com
> that have these games)
>
> www.dc.com (Deloitte Consulting)
>
> www.dialpad.com (user registration and member
> backend is PHP driven)
>
> www.thewb.com (uses PHP for the interactive
> areas such as message boards,
> polls, etc.)
>
>
> also:
>
> www.nbci.com
> www.sprint.ca
> www.ElectronicArts.com
> www.f2s.com
> www.indy500.com
> www.planetsourceocde.com
> www.easydns.com
> www.admworld.com
> www.communityconnect.com
> www.viant.com
> www.chek.com
>
>
> Some say that also HP, IBM, and even Mr. Microsoft run "some" Apache/PHP
> servers (looking it up on Netcraft.com--use their OS vendors search)
>
> Here is the link to a related discussion on PHP developers mailing list
> archive:
> http://marc.theaimsgroup.com/?t=99616558100011&w=4&r=1
>
> **
> All this data was composed from the posts of respectable developers on the
> international PHP mailing list.
> **
>
>
> Sincerely,
>
> Maxim Maletsky
> Founder, Chief Developer
>
> PHPBeginner.com (Where PHP Begins)
> maxim
phpbeginner.com
> www.phpbeginner.com
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Hi,
for a well-known PHP advocacy site we are searching for motivation studies of (big) companies who decided to use PHP.
A "PHP motivation study" is not like a normal case study where you tell the reader about the application foobar.com. Instead, you tell 'em about why, when and how you decided to use PHP for foobar.com, i.e. "because PHP is so easy to learn" or sth. like that (also interesting if you had the choice between PHP and [Perl|Java|Python|foo] and why you finally chose PHP).
If you're interested in that, please contact me for further details.
TIA, Björn Schotte.
-- Die Marktumfrage zu PHP Schulungen, Consultingdienstleistungen und frei verfügbaren Artikeln.Mitmachen? http://www.thinkphp.de/survey/survey.php
attached mail follows:
Hey all,
I'm wondering if anyone's created a custom function that'll perform SQL highlighting, similar to the highlight_file/string functions for PHP source. I made a quick hack, but I'd love to have something more consistent. Any ideas?
/* Chris Lambert, CTO - chris
whitecrown.net
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/
attached mail follows:
OK, I want to count the number of unique elements in an array, then print the total. However, both methods I've tried return "1"; the man pages explain that the count() function will return 1 if the var is set but not an array. But if you look at the 2nd method esp., I've set an if-else !is_set() alert which doesn't appear... Either way, it's a 1. Help!
Method 1:
<?
$count = array_unique(mysql_fetch_array($mysql_result));
$total = count($count);
print($total);
?>
Method 2:
<?
$array = mysql_fetch_array($mysql_result);
$newarray = array_values($array);
if (!is_array($newarray)) { print("Not an array");
} else {
$count = array_unique($newarray);
foreach($count as $key => $value) { $count[$key] = $value++; }
print($value);
} ?>
__________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
attached mail follows:
hi. php good for design web server because ,it use the best function of java,perl,html,...in itself.
but I dont know about difference between cgi and php??
love your enemies,because they cause to work harder. nafiseh.
attached mail follows:
Hello, it is quite simple, php is a programming language. CGI is an interface that execute programming language, usually Perl, but can be C, C++...
py
----- Original Message -----
From: "nafiseh saberi" <nsaberi
iraninfocenter.net>
To: <php-general
lists.php.net>
Sent: Saturday, August 18, 2001 4:46 AM
Subject: [PHP] advantage of php
>
> hi.
> php good for design web server because ,it
> use the best function of java,perl,html,...in itself.
>
> but I dont know about difference between cgi and php??
>
>
> love your enemies,because they cause to work harder.
> nafiseh.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
Has anyone ever come across a cgi 2 php program at all, similar to the asp2php program ?
or has anyone got a quick and easy tutorial for me to read through on what needs converting to what , language 2 language .
Steven
attached mail follows:
cgi is not actually a programming langauage, but is a way of accessing programs through a webserver. php can be run as a 'cgi' if you like.
i think what you mean is, has anyone seen a 'perl' to 'php' converter. perl is one of the most common languages used through cgi, and many of the scripts you see on the web are written in perl (look at the first line of the script).
i personally havent any such converter.
jamie burns.
"Steven Dowd" <steven.dowd
dowd.co.uk> wrote in message
news:036601c127e2$a78f67d0$0100a8c0
win2k...
> Has anyone ever come across a cgi 2 php program at all, similar to the
> asp2php program ?
>
> or has anyone got a quick and easy tutorial for me to read through on what
> needs converting to what , language 2 language .
>
> Steven
>
attached mail follows:
[I already sent this message to the php-db mailing list, but since it seems to be a low-traffic list, I thought I'd also send it to this list, thanks a lot for your answers :-)] Hi everybody !
I've got a quite confusing problem :
Yesterday, I upgraded my postgresql server from 7.0.3 to 7.1. I did some pg_dumps and created the DBS on the new server. Everything went fine.
But now, I've got some problems : When accessed through php, *sometimes* characters with accents don't come out right. I did some testing and the results are here :
-psql doesn't have this problem, so I think it is not a postgresql related thing. -When the database is created with a UNICODE encoding, accentuated characters appears as (xx). With a SQL_ANSII encoding, accentuated characters come out as other letters. phpPgAdmin also has this problem, as well as all the websites I have written.
Has anybody else had this problem, or does someone sees where I could watch further, I'm quite stuck ?
Thanks a lot for your replies.
Florian Blaser
attached mail follows:
On Sáb 18 Ago 2001 10:19, Florian Blaser wrote: > Hi everybody ! > > I've got a quite confusing problem : > > Yesterday, I upgraded my postgresql server from 7.0.3 to 7.1. I did some > pg_dumps and created the DBS on the new server. Everything went fine. > > But now, I've got some problems : When accessed through php, *sometimes* > characters with accents don't come out right. I did some testing and the > results are here : > > -psql doesn't have this problem, so I think it is not a postgresql related > thing.
psql, as well as pgaccess give me the encoded caracter instead of the acentuated vocal, but I don't mind, cuase psql is only for personal use. PHP gives me the right caracter.
> -When the database is created with a UNICODE encoding, accentuated > characters appears as (xx). With a SQL_ANSII encoding, accentuated > characters come out as other letters.
Which locale are you using (I think this has nothing to do with the problem, but who knows....).
> phpPgAdmin also has this problem, as well as all the websites I have > written.
I just checked a database which is been loaded with phpPgAdmin 2.3 and I got the acents OK.
> Has anybody else had this problem, or does someone sees where I could watch > further, I'm quite stuck ?
I really don't know where your problem can be. Try to set the environment variables correcty to your local locale. It could help.
Saludos... :-)
-- Porqué usar una base de datos relacional cualquiera, si podés usar PostgreSQL? ----------------------------------------------------------------- Martín Marqués | mmarquesunl.edu.ar Programador, Administrador, DBA | Centro de Telematica Universidad Nacional del Litoral -----------------------------------------------------------------
attached mail follows:
anyone got any inside info on waht this error means?
I changed one line of code.. and caboom..
- Peter
attached mail follows:
I hear this is achievable via php. My GD information is:
GD Support enabled GD Version 1.6.2 or higher FreeType Support enabled FreeType Linkage with TTF library GIF Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled
So could someone show me an example of how to overlay "hello2 onto file test.jpg.
thanks,
- seb
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]