php-general Digest 28 Apr 2010 06:39:57 - Issue 6716
Topics (messages 304680 through 304694):
Re: Error handling strategies (db related)
304680 by: Gary .
304682 by: Andrew Ballard
Re: php quiz script/tutorial
304681 by: Dotan Cohen
304683 by: Adam
class Pg_Error
{
private static $errors =
array(INTEGRITY_CONST_UNIQUE = 'uniqueness constraint violated');
...
public static function getMessage($ec)
{
$text = '';
if (array_key_exists($ec, Pg_Error::$errors))
{
$text =
Gary . wrote:
class Pg_Error
{
private static $errors =
array(INTEGRITY_CONST_UNIQUE = 'uniqueness constraint
violated');
...
public static function getMessage($ec)
{
$text = '';
if (array_key_exists($ec, Pg_Error::$errors))
{
On 28 April 2010 08:39, Gary . php-gene...@garydjones.name wrote:
class Pg_Error
{
private static $errors =
array(INTEGRITY_CONST_UNIQUE = 'uniqueness constraint violated');
...
public static function getMessage($ec)
{
$text = '';
if (array_key_exists($ec,
Per Jessen wrote:
Gary . wrote:
Calling it, the array_key_exists call always returns false
...
and I can't see what I've done wrong :(
Might this be better:
public static function getMessage($ec)
{
$text = '';
if (array_key_exists($ec, $errors))
{
On 4/28/10, Jochem Maas wrote:
Op 4/28/10 7:39 AM, Gary . schreef:
class Pg_Error
{
const INTEGRITY_CONST_UNIQUE = '23505';
private static $errors =
array(INTEGRITY_CONST_UNIQUE = 'uniqueness constraint violated');
...
public static function getMessage($ec)
{
On 27/04/10 16:37, tedd wrote:
Error handling is almost an art form.
More like a black art - voodoo perhaps...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 4/28/10, Jochem Maas wrote:
class Pg_Error
{
const INTEGRITY_CONST_UNIQUE = '23505';
this is a class constant
private static $errors =
array(INTEGRITY_CONST_UNIQUE = 'uniqueness constraint
violated');
[...]
unfortunately you cannot use a
On Tue, 2010-04-27 at 22:23 -0400, David McGlone wrote:
On Tuesday 27 April 2010 16:55:45 Ashley Sheridan wrote:
On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
Hi everyone.
I got a quickie LOL
is there a way to auto indent code. I'm using Kate and I have it set so
On Tue, 2010-04-27 at 23:25 -0400, Paul M Foster wrote:
On Tue, Apr 27, 2010 at 10:29:33PM -0400, David McGlone wrote:
On Tuesday 27 April 2010 19:00:29 D. Dante Lorenso wrote:
On 4/27/2010 3:55 PM, Ashley Sheridan wrote:
On Tue, 2010-04-27 at 16:33 -0400, David McGlone wrote:
Hi
On 28 April 2010 10:57, Gary . php-gene...@garydjones.name wrote:
On 4/28/10, Jochem Maas wrote:
class Pg_Error
{
const INTEGRITY_CONST_UNIQUE = '23505';
this is a class constant
private static $errors =
array(INTEGRITY_CONST_UNIQUE = 'uniqueness
Hi.
Just to let any of ye know that might be interested, there's a php.ie
meeting on tonight in Dublin - in the Longstone pub on Townsend Street
starting at eight o'clock.
It's located where the red diamond is on this map:
I asked something similar to this on the ph-db ml yesterday, but that
list seems to be almost dead.
The situation I have is that I am trying to get the postgres error
code (as opposed to some error message - see my other posts to this
list over the last day or so for the background to that). I
On Tue, Apr 27, 2010 at 10:33 PM, David McGlone wrote:
I'm using Kate
Since you've already had a suggestion to switch to Eclipse, I'll say
(+ emacs php-mode
(+ '(define-key php-mode-map (kbd RET) 'newline-and-indent)))
Or something like that.
--
PHP General Mailing List
On Wednesday 28 April 2010 05:00:34 Ashley Sheridan wrote:
On Tue, 2010-04-27 at 23:25 -0400, Paul M Foster wrote:
On Tue, Apr 27, 2010 at 10:29:33PM -0400, David McGlone wrote:
On Tuesday 27 April 2010 19:00:29 D. Dante Lorenso wrote:
On 4/27/2010 3:55 PM, Ashley Sheridan wrote:
On
Gary . wrote:
class Pg_Error
{
private static $errors =
array(INTEGRITY_CONST_UNIQUE = 'uniqueness constraint violated');
Shouldn't this be:
array(self::INTEGRITY_CONST_UNIQUE = 'uniqueness constraint violated');
...
public static function getMessage($ec)
{
Hello Guys,
I would like to implement a two color row table for some queries that I'm doing.
I use PHP to query a DB, then I use while to print all its results. I
have a code pretty similar to this one :
$results = Here the QUERY;
echo html;
echo head;
echo 'link
On 4/28/10, Thijs Lensselink wrote:
Gary . wrote:
class Pg_Error
{
private static $errors =
array(INTEGRITY_CONST_UNIQUE = 'uniqueness constraint violated');
Shouldn't this be:
array(self::INTEGRITY_CONST_UNIQUE = 'uniqueness constraint violated');
Yes, or something very like
On Wed, 2010-04-28 at 08:29 -0300, Juan Rodriguez Monti wrote:
Hello Guys,
I would like to implement a two color row table for some queries that I'm
doing.
I use PHP to query a DB, then I use while to print all its results. I
have a code pretty similar to this one :
$results = Here
[snip]
I just want to show you how I write the table. What I would like to
know is what do you suggest to do a two color row format.
[/snip]
Before your table;
$trColor = 0;
Then during the loop;
while(foo){
$tr = (0 == $trColor % 2)? #E8E8E8 : #FF;
echo tr style=\background-color:.$tr.\;
On 4/28/10, Juan Rodriguez Monti wrote:
I would like to implement a two color row table for some queries that I'm
doing.
...
what do you suggest to do a two color row format.
Well, I wouldn't mix the presentation and querying of the db in one
place, but assuming that's just a simplified
It isn't good idea to use php to visualize your table. You can fetch
you data by php and style them by java script.
On Wed, Apr 28, 2010 at 3:59 PM, Juan Rodriguez Monti
j...@rodriguezmonti.com.ar wrote:
Hello Guys,
I would like to implement a two color row table for some queries that I'm
On Wed, 2010-04-28 at 16:16 +0430, Ali Asghar Toraby Parizy wrote:
It isn't good idea to use php to visualize your table. You can fetch
you data by php and style them by java script.
On Wed, Apr 28, 2010 at 3:59 PM, Juan Rodriguez Monti
j...@rodriguezmonti.com.ar wrote:
Hello Guys,
I
2010/4/28 Jay Blanchard jblanch...@pocket.com:
[snip]
I just want to show you how I write the table. What I would like to
know is what do you suggest to do a two color row format.
[/snip]
Before your table;
$trColor = 0;
Then during the loop;
while(foo){
$tr = (0 == $trColor % 2)?
Gary . wrote:
On 4/28/10, Thijs Lensselink wrote:
Gary . wrote:
class Pg_Error
{
private static $errors =
array(INTEGRITY_CONST_UNIQUE = 'uniqueness constraint violated');
Shouldn't this be:
array(self::INTEGRITY_CONST_UNIQUE = 'uniqueness constraint violated');
[snip]
Before your table;
$trColor = 0;
Then during the loop;
while(foo){
$tr = (0 == $trColor % 2)? #E8E8E8 : #FF;
echo tr style=\background-color:.$tr.\;
...
Replace the hex values with the colors you desire.
Just one more question about this.
I'm getting something like
On Wed, Apr 28, 2010 at 2:17 PM, Thijs Lensselink wrote:
Gary . wrote:
On 4/28/10, Thijs Lensselink wrote:
Gary . wrote:
class Pg_Error
{
private static $errors =
array(INTEGRITY_CONST_UNIQUE = 'uniqueness constraint
violated');
Shouldn't this be:
Like this?
$color[0] = 'red';
$color[1] = 'blue';
for ($i=0;foo;$i++) {
echo 'tr style:background-color:'.$color[$i%2]...
regards
Jochen
Jay Blanchard schrieb:
[snip]
Before your table;
$trColor = 0;
Then during the loop;
while(foo){
$tr = (0 == $trColor % 2)? #E8E8E8 : #FF;
echo tr
2010/4/28 Jay Blanchard jblanch...@pocket.com:
[snip]
Before your table;
$trColor = 0;
Then during the loop;
while(foo){
$tr = (0 == $trColor % 2)? #E8E8E8 : #FF;
echo tr style=\background-color:.$tr.\;
...
Replace the hex values with the colors you desire.
Just one more
On Tue, Apr 27, 2010 at 7:34 PM, Gary . php-gene...@garydjones.name wrote:
On Tue, Apr 27, 2010 at 10:46 AM, Peter Lind wrote:
On 27 April 2010 10:42, Gary . wrote:
How do you guys handle errors during, say, db insertions.
Let's say you have an ongoing transaction which fails on the n-th
I agree with you. in this simple example we can use php but we may need
table with extra functionality and only client side scripts are reasonable
and applicable. we can create multi color and clickable rows by php but
we'll have greater server load.
anyway that was only an propose;-)
On Wed, Apr
On Wed, Apr 28, 2010 at 09:52:16AM +0100, Ashley Sheridan wrote:
snip
I set it to use tabs of 4 spaces wide and use c-style indenting. It
doesn't automatically indent as I write, but I find it a good thing that
an editor doesn't change anything I write, as that is where problems can
occur!
What about this:
$color = even;
while ($row = while condition )) {
$color = ($color == even) ? odd : even;
echo (tr class=\$color\);
echo td$row[0]/tdtd$row[1]/td
td$row[2]/tdtd$row[3]/tdtd$row[4]/td ;
echo (/tr)
}
And have two classes in your style sheet that
On Wed, 2010-04-28 at 17:59 +0430, Ali Asghar Toraby Parizy wrote:
I agree with you. in this simple example we can use php but we may
need table with extra functionality and only client side scripts are
reasonable and applicable. we can create multi color and clickable
rows by php but we'll
On Wed, 2010-04-28 at 09:34 -0400, Fernando wrote:
What about this:
$color = even;
while ($row = while condition )) {
$color = ($color == even) ? odd : even;
echo (tr class=\$color\);
echo td$row[0]/tdtd$row[1]/td
td$row[2]/tdtd$row[3]/tdtd$row[4]/td ;
But then you need to differentiate the table, otherwise all your tables
will have the same row formating no? This way you only apply the
formating to those rows that need it.
Fernando.
On 28/04/2010 09:35, Ashley Sheridan wrote:
On Wed, 2010-04-28 at 09:34 -0400, Fernando wrote:
What
On Wed, 2010-04-28 at 09:46 -0400, Fernando wrote:
But then you need to differentiate the table, otherwise all your tables
will have the same row formating no? This way you only apply the
formating to those rows that need it.
Fernando.
On 28/04/2010 09:35, Ashley Sheridan wrote:
On
2010/4/28 Fernando ferna...@ggtours.ca:
What about this:
$color = even;
while ($row = while condition )) {
$color = ($color == even) ? odd : even;
echo (tr class=\$color\);
echo td$row[0]/tdtd$row[1]/td
td$row[2]/tdtd$row[3]/tdtd$row[4]/td ;
echo (/tr)
}
And
From: Ashley Sheridan
On Wed, 2010-04-28 at 09:46 -0400, Fernando wrote:
But then you need to differentiate the table, otherwise all your
tables
will have the same row formating no? This way you only apply the
formating to those rows that need it.
Yes, but one would assume you'd be
On 28 April 2010 12:29, Juan Rodriguez Monti j...@rodriguezmonti.com.ar wrote:
Hello Guys,
I would like to implement a two color row table for some queries that I'm
doing.
I use PHP to query a DB, then I use while to print all its results. I
have a code pretty similar to this one :
On Wed, Apr 28, 2010 at 05:47, Ken Guest k...@linux.ie wrote:
Hi.
Just to let any of ye know that might be interested, there's a php.ie
meeting on tonight in Dublin - in the Longstone pub on Townsend Street
starting at eight o'clock.
It's located where the red diamond is on this map:
On Wed, Apr 28, 2010 at 3:38 PM, Daniel Brown danbr...@php.net wrote:
On Wed, Apr 28, 2010 at 05:47, Ken Guest k...@linux.ie wrote:
Hi.
Just to let any of ye know that might be interested, there's a php.ie
meeting on tonight in Dublin - in the Longstone pub on Townsend Street
starting at
On Wed, Apr 28, 2010 at 11:28, Ken Guest k...@linux.ie wrote:
that would be a handy idea ;-)
Next time the mirrors update, that link will be included in the
event details. Should be in under 90 minutes for the majority of the
world.
--
/Daniel P. Brown
daniel.br...@parasane.net ||
Hi folks,
This isn't really a PHP question per se, but could apply to any
language...
I have a public facing web server, which we have a software component
that helps protect us from SQL Injection, and the like.
We recently have added a very small web application that is vendor
Hello David,
I'm not a PHP god but I would never ever do such things.I can't even
imagine what can be the reason of passing an SQL query through a
form...
--
With best regards from Ukraine,
Andre
Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @
jabber.org
Yahoo! messenger:
On Wed, Apr 28, 2010 at 04:54:56PM -0400, David Stoltz wrote:
Hi folks,
This isn't really a PHP question per se, but could apply to any
language...
I have a public facing web server, which we have a software component
that helps protect us from SQL Injection, and the like.
David Stoltz wrote:
Hi folks,
This isn't really a PHP question per se, but could apply to any
language...
I have a public facing web server, which we have a software component
that helps protect us from SQL Injection, and the like.
We recently have added a very small web application that is
On Wed, Apr 28, 2010 at 4:02 PM, Andre Polykanine an...@oire.org wrote:
Hello David,
I'm not a PHP god but I would never ever do such things.I can't even
imagine what can be the reason of passing an SQL query through a
form...
--
With best regards from Ukraine,
Andre
Skype: Francophile;
Hi all,
I am learning PHP and found this problem to be interesting.
I personally would never do this myself. All the manuals I have read
strictly prohibit this type of behavior.
Wouldn't you just have them run the queries on their end and send you
the results instead of the query itself?
I think the answer is: ISPs have a different range of addresses from
host providers, so it is possible to block requests from host servers,
so from scripts.
John
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Wed, 28 Apr 2010 16:54:56 -0400, David Stoltz wrote:
[...]
We recently have added a very small web application that is vendor
supported. They said it's not working, so I investigated. I found that
our software protection was blocking their pages because they are
actually passing entire SQL
On Thu, 2010-04-29 at 08:49 +1000, Ross McKay wrote:
On Wed, 28 Apr 2010 16:54:56 -0400, David Stoltz wrote:
[...]
We recently have added a very small web application that is vendor
supported. They said it's not working, so I investigated. I found that
our software protection was blocking
-Original Message-
From: ioan...@btinternet.com [mailto:ioan...@btinternet.com]
Sent: Wednesday, April 28, 2010 7:03 AM
To: 'PHP'
Subject: Re: [PHP] CURL cannot connect to URL - IP address - after
successful
connection
I think the answer is: ISPs have a different range of
Hi all,
This isn't exactly a PHP question, but I don't know anyone else with the
collected smarts of this list. Basically, a site I built and am managing
has been identified by Google as a source of malware. Now, I've been
over the source code with a fine-toothed comb and found nothing, I've
gone
On Wed, Apr 28, 2010 at 19:50, Ashley Sheridan a...@ashleysheridan.co.uk
wrote:
The Google webmaster tools tell me nothing more than 'Of the 2 pages we
tested on the site over the past 90 days, 2 page(s) resulted in
malicious software being downloaded and installed without user consent.'
It
On Thu, 29 Apr 2010 00:50:52 +0100, Ashley Sheridan wrote:
This isn't exactly a PHP question, but I don't know anyone else with the
collected smarts of this list. Basically, a site I built and am managing
has been identified by Google as a source of malware. [...]
Check the sites you link to. We
56 matches
Mail list logo