php-general Digest 11 May 2011 11:38:09 -0000 Issue 7307

Topics (messages 312743 through 312756):

Re: Bold links
        312743 by: Stuart Dallas
        312746 by: Micky Hulse
        312747 by: Joshua Kehn
        312748 by: Adam Richardson
        312749 by: Ashley Sheridan
        312751 by: tedd
        312752 by: Adam Richardson

Short tag: why is it bad practice?
        312744 by: Andre Polykanine
        312745 by: Joshua Kehn
        312756 by: Alejandro Michelin Salomon (Hotmail)

Re: Error Reporting/Display Errors Issues?
        312750 by: Mike Mackintosh

How in PDOStatement->fetchAll use PDO::FETCH_GROUP for grouping more than one 
column simultaneously?
        312753 by: Михаил Гаврилов

Storing indefinite arrays in database
        312754 by: Benedikt Voigt
        312755 by: Bastien Koert

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Tuesday, 10 May 2011 at 15:41, tedd wrote:
At 3:53 PM -0700 5/9/11, Micky Hulse wrote:
> > On Mon, May 9, 2011 at 2:56 PM, tedd <tedd.sperl...@gmail.com> wrote:
> > >  Really?
> > >  How does the blind via readers, such as JAWS, understand what a <B> is?
> > >  First, never use <B> -- or <I> for that matter.
> > >  Second, use <strong> or <em> instead. Readers can understand and render
> > >  STRONG and EMPHASIZED text, but not <B> and <I> text -- those tags mean
> > >  nothing and that's the reason why they are not encouraged for use and 
> > > even
> > >  removed from XHTML.
> > >  Third, if neither of those tags (i.e., <strong> or <em> ) work for you, 
> > > they
> > >  try using a class (or an id) with a css rule of:
> > 
> > [OT]
> > 
> > Tedd, it seems like you are spreading a little bit of mis-information here.
> 
> Micky:
> 
> I see that you brought your authority to the argument, namely:
> 
> http://html5doctor.com/i-b-em-strong-element/
> 
> So, allow me to bring mine -- my information/position stems from my 
> understanding derived from both daily practice and constant reading. 
> In addition to reading links like the above (which I read btw), I 
> also read several list provided by disability concerns, such as 
> "webdev.lists.d.umn.edu" being the best. In addition to all that, I 
> also read several technical books each week re these subjects.
> 
> For example, within this last month I've purchased and read HTML5 by 
> Lawson, Smashing CSS by Meyer, 100 Things by Weinschenk, Learning Web 
> Design by Robbins, Designing with the Mind in Mind by Johnson, Forms 
> that work by Jarret, Build your own web site the right way by Lloyd, 
> PHP 5.3 by Doyle, and Expert PHP and MySQL by Cuniosoa. That's a lot 
> of reading, -- so I think I keep up with what's going on.
> 
> While it is true that html5 brought back tags such as <b> and <i>, 
> but it has also brought back <table> for presentation. I leave the 
> reader (and the future) to judge the wisdom of that decision.
> 
> I think we all realize the problems that these tags bring to the 
> table (no pun intended). We can either continue to resolve the 
> problems they present or we can resort back to the way things were.
> 
> As for me, I choose to never use <b> and <i> for anything PERIOD and 
> to speak out against their use whenever I can. As for <table> in 
> presentation, I am still undecided. While I would never use tables 
> for the presentation of text, I often use simple tables (i.e., no 
> nesting) for holding forms together. However, I am leaning toward not 
> using tables for that either.
> 
> The world is changing and I don't think any organization can dictate 
> what is the right/wrong way to do anything. But the good thing here 
> is that we are left to our own judgement as to what we support and 
> what we condemn. In my judgment, the <b> and <i> tags present more 
> problems than they solve so I will continue to not use those tags and 
> speak against them.

While I don't necessarily disagree with your point about HTML5 bringing back 
prehistoric tags, I do think it's important to remember that the fundamental 
reason for having the spec is that everyone (developers, browsers, 
screenreaders, etc) are working from the same guidelines. You have to assume 
that HTML5 consumption devices (both software and hardware) will follow the 
spec, so as a developer I think it's important to do the same regardless of 
your philosophical arguments against the decisions made when that spec was 
written.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/





--- End Message ---
--- Begin Message ---
[OT]

Thanks for the informative reply Tedd.

I respect your opinion and I don't think my approach is more right
than yours. I am wondering if this is just a DTD thing. I always use
an HTML 4.01 strict DTD and have not used an XHTML doctype in ages.

As far as I can tell, the specs in XHTML say "not recommended", but I
can't find similar text in HTML 4.01 specs.

<b>Jenkins</b> vs. <span class="baz">Jenkins</span>

... to me, the latter seems to be overkill.

<b class="baz">Jenkins</b>

I can't of many times I have done the above... If I need to hook into
the <b> or <i> I might just do this (for example):

<div id="wrapper">Bob <b>Jenkins</b></div>

#wrapper b { do whatever here }

On Tue, May 10, 2011 at 7:41 AM, tedd <tedd.sperl...@gmail.com> wrote:
> As for me, I choose to never use <b> and <i> for anything PERIOD and to
> speak out against their use whenever I can. As for <table> in presentation,
> judgment, the <b> and <i> tags present more problems than they solve so I
> will continue to not use those tags and speak against them.

Looking at your site:

http://sperling.com/

Viewing the source code on your homepage, I see <b> used 15 times in
the body copy.

I am assuming that maybe you have no control over that portion of your
site due to the CMS you are using?

Could you imagine using <strong> in all those instances where you used
<b>? Don't you think that would be overkill?

Sorry to everyone for taking this so OT for the PHP list.

[/OT]

Micky

--- End Message ---
--- Begin Message ---
On May 10, 2011, at 1:10 PM, Micky Hulse wrote:

> [OT]
> 
> Thanks for the informative reply Tedd.
> 
> I respect your opinion and I don't think my approach is more right
> than yours. I am wondering if this is just a DTD thing. I always use
> an HTML 4.01 strict DTD and have not used an XHTML doctype in ages.
> 
> As far as I can tell, the specs in XHTML say "not recommended", but I
> can't find similar text in HTML 4.01 specs.
> 
> <b>Jenkins</b> vs. <span class="baz">Jenkins</span>
> 
> ... to me, the latter seems to be overkill.
> 
> <b class="baz">Jenkins</b>
> 
> I can't of many times I have done the above... If I need to hook into
> the <b> or <i> I might just do this (for example):
> 
> <div id="wrapper">Bob <b>Jenkins</b></div>
> 
> #wrapper b { do whatever here }
> 
> On Tue, May 10, 2011 at 7:41 AM, tedd <tedd.sperl...@gmail.com> wrote:
>> As for me, I choose to never use <b> and <i> for anything PERIOD and to
>> speak out against their use whenever I can. As for <table> in presentation,
>> judgment, the <b> and <i> tags present more problems than they solve so I
>> will continue to not use those tags and speak against them.
> 
> Looking at your site:
> 
> http://sperling.com/
> 
> Viewing the source code on your homepage, I see <b> used 15 times in
> the body copy.
> 
> I am assuming that maybe you have no control over that portion of your
> site due to the CMS you are using?
> 
> Could you imagine using <strong> in all those instances where you used
> <b>? Don't you think that would be overkill?
> 
> Sorry to everyone for taking this so OT for the PHP list.
> 
> [/OT]
> 
> Micky


Unless he is specifically saying to use .php extensions for url's I doubt it's 
a CMS. 

Regards,

-Josh
____________________________________
Joshua Kehn | josh.k...@gmail.com
http://joshuakehn.com


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

How's it going? I'm very pleased with the emphasis on accessibility you
bring to the PHP list, but I do believe you're overstating a few points
below.


> So, allow me to bring mine -- my information/position stems from my
> understanding derived from both daily practice and constant reading. In
> addition to reading links like the above (which I read  btw), I also read
> several list provided by disability concerns, such as "
> webdev.lists.d.umn.edu" being the best. In addition to all that, I also
> read several technical books each week re these subjects.
>

I'm thankful you've had the chance to inform your perspective on
development.


> For example, within this last month I've purchased and read HTML5 by
> Lawson, Smashing CSS by Meyer, 100 Things by Weinschenk, Learning Web Design
> by Robbins, Designing with the Mind in Mind by Johnson, Forms that work by
> Jarret, Build your own web site the right way by Lloyd, PHP 5.3 by Doyle,
> and Expert PHP and MySQL by Cuniosoa.  That's a lot of reading, -- so I
> think I keep up with what's going on.
>

Of the above books, which actually speaks to semantically appropriate
markup, and of that subset, which actually references the rationale for the
change in semantics of the <b> tag? And, of that subset, which argues
against using the <b> and <i> tags as recommended in the editors draft?

I know that the Lawson book you mentioned references the <b> tag on 59, but
it does not disparage it's use (rather, it provides an example of the
appropriate use under (X)HTML5.) So that source would seem to support the
use of the <b> when semantically appropriate, just as Pilgram's book does.

The rest of the list does show you've read a fair amount in the past month
(just as others on this list, including me), but what does it do to
specifically support your argument?


> While it is true that html5 brought back tags such as <b> and <i>, but it
> has also brought back <table> for presentation. I leave the reader (and the
> future) to judge the wisdom of that decision.
>

The discussion is not about the table element's role attribute in (X)HTML5,
the discussion was centered on the specific change to the meaning of the <b>
tag. Even if the table tag implementation is questionable, that does not
mean all of the new semantics for the <b> are questionable. Each feature
stands on its own merits.


> I think we all realize the problems that these tags bring to the table (no
> pun intended). We can either continue to resolve the problems they present
> or we can resort back to the way things were.
>

Again, the <table> tag was not the discussion. How would you markup text
that should be "stylistically offset from the normal prose without conveying
any extra importance...?" You could choose to use a span tag. However, I
would, following the W3C quote above, choose to use the <b> tag as HTML5
becomes better supported.


> As for me, I choose to never use <b> and <i> for anything PERIOD and to
> speak out against their use whenever I can. As for <table> in presentation,
> I am still undecided. While I would never use tables for the presentation of
> text, I often use simple tables (i.e., no nesting) for holding forms
> together. However, I am leaning toward not using tables for that either.
>

I believe you have some <b> tags in your site.

The world is changing and I don't think any organization can dictate what is
> the right/wrong way to do anything. But the good thing here is that we are
> left to our own judgement as to what we support and what we condemn. In my
> judgment, the <b> and <i> tags present more problems than they solve so I
> will continue to not use those tags and speak against them.


Our own judgement AND the standards set out there by the community of
professional web developers. The W3C is clearly moving to standardizing a
new use for the <b> and <i> tags, and I will try to follow the standard, as
other software developers (including those who develop screen readers) will
do to try and improve the user experience.

Again, I greatly respect you, Ted, I have learned much from your posts, and
this discussion does not detract from that. However, I want to make sure the
developers subscribing to the list will consider the use of the <i> and <b>
tags as recommended by the W3C in (X)HTML5.

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com

--- End Message ---
--- Begin Message ---
On Tue, 2011-05-10 at 13:46 -0400, Adam Richardson wrote:

> Hi Tedd,
> 
> How's it going? I'm very pleased with the emphasis on accessibility you
> bring to the PHP list, but I do believe you're overstating a few points
> below.
> 
> 
> > So, allow me to bring mine -- my information/position stems from my
> > understanding derived from both daily practice and constant reading. In
> > addition to reading links like the above (which I read  btw), I also read
> > several list provided by disability concerns, such as "
> > webdev.lists.d.umn.edu" being the best. In addition to all that, I also
> > read several technical books each week re these subjects.
> >
> 
> I'm thankful you've had the chance to inform your perspective on
> development.
> 
> 
> > For example, within this last month I've purchased and read HTML5 by
> > Lawson, Smashing CSS by Meyer, 100 Things by Weinschenk, Learning Web Design
> > by Robbins, Designing with the Mind in Mind by Johnson, Forms that work by
> > Jarret, Build your own web site the right way by Lloyd, PHP 5.3 by Doyle,
> > and Expert PHP and MySQL by Cuniosoa.  That's a lot of reading, -- so I
> > think I keep up with what's going on.
> >
> 
> Of the above books, which actually speaks to semantically appropriate
> markup, and of that subset, which actually references the rationale for the
> change in semantics of the <b> tag? And, of that subset, which argues
> against using the <b> and <i> tags as recommended in the editors draft?
> 
> I know that the Lawson book you mentioned references the <b> tag on 59, but
> it does not disparage it's use (rather, it provides an example of the
> appropriate use under (X)HTML5.) So that source would seem to support the
> use of the <b> when semantically appropriate, just as Pilgram's book does.
> 
> The rest of the list does show you've read a fair amount in the past month
> (just as others on this list, including me), but what does it do to
> specifically support your argument?
> 
> 
> > While it is true that html5 brought back tags such as <b> and <i>, but it
> > has also brought back <table> for presentation. I leave the reader (and the
> > future) to judge the wisdom of that decision.
> >
> 
> The discussion is not about the table element's role attribute in (X)HTML5,
> the discussion was centered on the specific change to the meaning of the <b>
> tag. Even if the table tag implementation is questionable, that does not
> mean all of the new semantics for the <b> are questionable. Each feature
> stands on its own merits.
> 
> 
> > I think we all realize the problems that these tags bring to the table (no
> > pun intended). We can either continue to resolve the problems they present
> > or we can resort back to the way things were.
> >
> 
> Again, the <table> tag was not the discussion. How would you markup text
> that should be "stylistically offset from the normal prose without conveying
> any extra importance...?" You could choose to use a span tag. However, I
> would, following the W3C quote above, choose to use the <b> tag as HTML5
> becomes better supported.
> 
> 
> > As for me, I choose to never use <b> and <i> for anything PERIOD and to
> > speak out against their use whenever I can. As for <table> in presentation,
> > I am still undecided. While I would never use tables for the presentation of
> > text, I often use simple tables (i.e., no nesting) for holding forms
> > together. However, I am leaning toward not using tables for that either.
> >
> 
> I believe you have some <b> tags in your site.
> 
> The world is changing and I don't think any organization can dictate what is
> > the right/wrong way to do anything. But the good thing here is that we are
> > left to our own judgement as to what we support and what we condemn. In my
> > judgment, the <b> and <i> tags present more problems than they solve so I
> > will continue to not use those tags and speak against them.
> 
> 
> Our own judgement AND the standards set out there by the community of
> professional web developers. The W3C is clearly moving to standardizing a
> new use for the <b> and <i> tags, and I will try to follow the standard, as
> other software developers (including those who develop screen readers) will
> do to try and improve the user experience.
> 
> Again, I greatly respect you, Ted, I have learned much from your posts, and
> this discussion does not detract from that. However, I want to make sure the
> developers subscribing to the list will consider the use of the <i> and <b>
> tags as recommended by the W3C in (X)HTML5.
> 
> Adam
> 


I've read this thread right through and I have to agree with Tedd. The
new HTML5 spec might say it's fine to use <b> and <i> now for certain
cases, but I still would use <strong> and <em> for the majority of those
and other markup where else I could.

Consider the example which started this thread. It was merely to make
part of a name bold. Here is how I probably would have marked it up to
give it a semantic meaning:

<span class="name">John <span class="surname">Smith</span></span>

Easy to style however I wanted, easy to read the code and infer the
meaning, and I believe there are things out there which digest content
and make rudimentary attempts to decipher the meaning from simple
classes such as these. In-fact, it was from simple class definitions
like these that led to the creation of the new tags in HTML5 such as
<footer> and <nav>. I feel it's only a matter of time before more tags
are added to the mix (within limits of course, we don't want to remember
a list of a million tags every time we fire up our editors to create
something!) to make things even more semantic. For me, accessibility is
only a hop away from semantics, so I try to avoid what I consider "bad"
markup wherever I can. Although, as others have said, what is bad is
largely, in part, down to user preference.

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
At 10:10 AM -0700 5/10/11, Micky Hulse wrote:
Looking at your site:

http://sperling.com/

Viewing the source code on your homepage, I see <b> used 15 times in
the body copy.

You are absolutely right!

I do know that the copy before that used <em>, but for some reason unrealized by me that copy was removed and replaced with the <b> one -- my bad!!!

I will correct this within the week.

Thanks for pointing that out -- if I preach something I should practice it.

As for this being on topic or off, dealing with disability issues should always be on topic. Remember, it was a PHP question that started this.

Cheers,

tedd

--
-------
http://sperling.com/

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

I want to clarify a couple points.

On Tue, May 10, 2011 at 2:27 PM, Ashley Sheridan
<a...@ashleysheridan.co.uk>wrote:

>  On Tue, 2011-05-10 at 13:46 -0400, Adam Richardson wrote:
>
> Hi Tedd,
>
> How's it going? I'm very pleased with the emphasis on accessibility you
> bring to the PHP list, but I do believe you're overstating a few points
> below.
> [Omitted for brevity]
>
> I've read this thread right through and I have to agree with Tedd. The new
> HTML5 spec might say it's fine to use <b> and <i> now for certain cases, but
> I still would use <strong> and <em> for the majority of those and other
> markup where else I could.
>

I posted because Ted said "First, never use <B> -- or <I> for that matter."
My objection was to that specific statement.

I don't think the spec says it is "fine to use <b> and <i> for certain", but
rather it points out appropriate uses of the tags given the (X)HTML5 spec.


> Consider the example which started this thread. It was merely to make part
> of a name bold. Here is how I probably would have marked it up to give it a
> semantic meaning:
>
> <span class="name">John <span class="surname">Smith</span></span>
>

We're not in disagreement here. I specifically pointed out that "You could
choose to use a span tag" in my example. Such would be perfectly acceptable.

The spec even says:

The b <http://dev.w3.org/html5/spec/Overview.html#the-b-element> element
> should be used as a last resort when no other element is more appropriate.
> In particular, headings should use the 
> h1<http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements>
>  to 
> h6<http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements>
>  elements,
> stress emphasis should use 
> theem<http://dev.w3.org/html5/spec/Overview.html#the-em-element> element,
> importance should be denoted with the 
> strong<http://dev.w3.org/html5/spec/Overview.html#the-strong-element> element,
> and text marked or highlighted should use the 
> mark<http://dev.w3.org/html5/spec/Overview.html#the-mark-element>
>  element.


There's a similar caveat for the <i> tag, too. That said, if I was going to
add the semantics you suggested, I'd probably use the hCard standard to
facilitate the acquisition of this meta information:

<div id="hcard-John-Robert-Smith" class="vcard">
 <span class="fn n">
  <span class="given-name">John</span>
  <span class="additional-name">Robert</span>
  <span class="family-name">Smith</span>
</span>
</div>

But it's here that we diverge I believe, as I believe that if I've exhausted
the alternatives, as in the case of the examples included in the spec, one
can appropriately use a <b> tag. And, I also see appropriate uses for the
<i> tag in light of the spec.


> Easy to style however I wanted, easy to read the code and infer the
> meaning, and I believe there are things out there which digest content and
> make rudimentary attempts to decipher the meaning from simple classes such
> as these. In-fact, it was from simple class definitions like these that led
> to the creation of the new tags in HTML5 such as <footer> and <nav>.
>

Absolutely right! Class names are very helpful. The spec even points out for
the <i> that:

Authors can use the
class<http://dev.w3.org/html5/spec/Overview.html#classes> attribute
> on the i <http://dev.w3.org/html5/spec/Overview.html#the-i-element> element
> to identify why the element is being used, so that if the style of a
> particular use (e.g. dream sequences as opposed to taxonomic terms) is to be
> changed at a later date, the author doesn't have to go through the entire
> document (or series of related documents) annotating each use.


And, I would also point out that it was these same classes that you noted
for footers and navs that lead to the change in the <b> and <i> tags.

I feel it's only a matter of time before more tags are added to the mix
> (within limits of course, we don't want to remember a list of a million tags
> every time we fire up our editors to create something!) to make things even
> more semantic. For me, accessibility is only a hop away from semantics, so I
> try to avoid what I consider "bad" markup wherever I can. Although, as
> others have said, what is bad is largely, in part, down to user preference.
>

I agree. That said, it sounds like we might differ in the perceived value of
the <b> and <i> tags for semantics and accessibility. When I read the
(X)HTML5 spec, especially for the <i> tag (see quoted text below), I see
great hope for improving the user experience of those using text-to-speech
software. I hear the speaker using different styles of speech to reflect
<em> tags, <strong> tags, AND <i> tags in ways that make me excited for the
future of accessibility. That is why I believe there are times for the
appropriate use of <b> and <i> tags.

The i <http://dev.w3.org/html5/spec/Overview.html#the-i-element> element
> represents <http://dev.w3.org/html5/spec/Overview.html#represents> a span
> of text in an alternate voice or mood, or otherwise offset from the normal
> prose in a manner indicating a different quality of text, such as a
> taxonomic designation, a technical term, an idiomatic phrase from another
> language, a thought, or a ship name in Western texts.


I'll sign off on this thread, sorry to trouble the list with such thick
posts.

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com

--- End Message ---
--- Begin Message ---
Hi everyone,
Many  times  I heard that the following two peaces of code are written
in a bad manner:
1.
<?
echo "Hello, world!";
?>

2.
<form action="script.php" method="post">
<p>Your   e-mail:   <input   type="text"   id="uemail"   name="uemail"
value="<?=$f['Email']?>"></p>
...
</form>

As for now, I use both quite often. Why is this considered not kosher,
I mean, good coding practice?
Thanks!

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion


--- End Message ---
--- Begin Message ---
On May 10, 2011, at 11:11 AM, Andre Polykanine wrote:

> Hi everyone,
> Many  times  I heard that the following two peaces of code are written
> in a bad manner:
> 1.
> <?
> echo "Hello, world!";
> ?>
> 
> 2.
> <form action="script.php" method="post">
> <p>Your   e-mail:   <input   type="text"   id="uemail"   name="uemail"
> value="<?=$f['Email']?>"></p>
> ...
> </form>
> 
> As for now, I use both quite often. Why is this considered not kosher,
> I mean, good coding practice?
> Thanks!
> 
> -- 
> With best regards from Ukraine,
> Andre
> Skype: Francophile
> Twitter: http://twitter.com/m_elensule
> Facebook: http://facebook.com/menelion


Because short tags aren't always enabled and can cause things to break when 
deploying code to different environments. Best practice dictates that your code 
should be as environmentally independent as possible.

It's another few characters, why neglect it?

Regards,

-Josh
____________________________________
Joshua Kehn | josh.k...@gmail.com
http://joshuakehn.com


--- End Message ---
--- Begin Message ---
Andre :

As Joshua says, the only php tags that always is enabled is <?php ?>, this
is the default php tag, and never can be disabled.

This <? ?> is enabled if short_open_tag is on
And this <% %> is enabled if asp_tags is on

But the default is off for both.

Use this <?php ?>, and forgive configuration options.

Alejandro M.S.

-----Mensagem original-----
De: Joshua Kehn [mailto:josh.k...@gmail.com] 
Enviada em: terça-feira, 10 de maio de 2011 12:19
Para: Andre Polykanine
Cc: php-gene...@lists.php.net
Assunto: Re: [PHP] Short tag: why is it bad practice?

On May 10, 2011, at 11:11 AM, Andre Polykanine wrote:

> Hi everyone,
> Many  times  I heard that the following two peaces of code are written
> in a bad manner:
> 1.
> <?
> echo "Hello, world!";
> ?>
> 
> 2.
> <form action="script.php" method="post">
> <p>Your   e-mail:   <input   type="text"   id="uemail"   name="uemail"
> value="<?=$f['Email']?>"></p>
> ...
> </form>
> 
> As for now, I use both quite often. Why is this considered not kosher,
> I mean, good coding practice?
> Thanks!
> 
> -- 
> With best regards from Ukraine,
> Andre
> Skype: Francophile
> Twitter: http://twitter.com/m_elensule
> Facebook: http://facebook.com/menelion


Because short tags aren't always enabled and can cause things to break when
deploying code to different environments. Best practice dictates that your
code should be as environmentally independent as possible.

It's another few characters, why neglect it?

Regards,

-Josh
____________________________________
Joshua Kehn | josh.k...@gmail.com
http://joshuakehn.com


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



--- End Message ---
--- Begin Message ---
Unfortunately setting that within the PHP file directly still results in errors 
and notices being displayed. I'm at a loss.

Sent from my iPhone

On May 10, 2011, at 5:40, <ad...@buskirkgraphics.com> wrote:

> Try this for me in a page you wish to not display errors.
> <?php
> 
> error_reporting(0);
> ini_set('display_errors', 0);
> 
> ?>
> 
> 
> What you are doing with this function is over riding the php.ini file and
> turning off the errors on that page.
> Place the code at the beginning of php before any includes.
> 
> If this works errors are turned on or your disabling function is malformed.
> 
> 
> 
> Richard L. Buskirk
> 
> 
> 
> -----Original Message-----
> From: Mike Mackintosh [mailto:mike.mackint...@angrystatic.com] 
> Sent: Monday, May 09, 2011 10:34 PM
> To: php-gene...@lists.php.net
> Subject: [PHP] Error Reporting/Display Errors Issues?
> 
> Anyone else notice PHP throwing Warning and Notices even when display errors
> and error reporting disabled?
> 
> I compiled PHP with the following:
> 
> './configure'  '--prefix=/usr/local/php-5.3.3' '--enable-cli'
> '--disable-debug' '--disable-rpath' '--disable-static' '--with-pic'
> '--with-openssl=/usr' '--enab
> le-bcmath' '--with-bz2' '--enable-calendar' '--enable-ctype' '--with-curl'
> '--with-zlib-dir=/usr' '--with-xsl' '--enable-exif' '--enable-ftp'
> '--with-gd' '--enable-gd-native-ttf' '-
> -with-ttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr'
> '--with-freetype-dir=/usr' '--with-gettext' '--with-iconv' '--with-imap'
> '--with-kerberos=/usr' '--with-imap-ssl=/usr' '--ena
> ble-mbstring' '--with-mcrypt' '--with-mhash' '--with-mime-magic'
> '--with-mysql=/usr/local/mysql-5.1.49' '--with-pcre-regex=/usr'
> '--with-pspell=/usr' '--enable-sockets' '--enable-wd
> dx' '--with-xmlrpc' '--with-zlib=/usr' '--with-pear' '--with-layout=GNU'
> '--with-ldap' '--enable-pdo' '--enable-soap'
> '--with-apxs2=/usr/local/apache-2.2.16/bin/apxs' '--enable-pcnt
> l' '--enable-mailparse' '--enable-zip' '--with-zip=/usr' '--with-bz2=/usr'
> '--with-config-file-path=/etc'
> '--with-config-file-scan-dir=/usr/local/php-5.3.3/etc' '--with-pdo-mysql=/u
> sr/local/mysql-5.1.49' '--with-openssl=/usr'
> 
> I have also set the following:
> 
> display_errors => Off => Off
> display_startup_errors => Off => Off
> error_append_string => no value => no value
> error_log => no value => no value
> error_prepend_string => no value => no value
> error_reporting => 0 => 0
> 
> But i continue to receive Strict/Notice and Warnings in code that i wish to
> be hidden.
> 
> Any suggestions?
> 
> Thanks,
> 
> Mike
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
How in PDOStatement->fetchAll use PDO::FETCH_GROUP for grouping more
than one column simultaneously?

For example

col1  col2  col3  col4
13     p1       1     boroda
13     p1       1     boroda 2
13     p1       2     boroda 3
13     p2       2     boroda 4
13     p2       2     boroda 5
14     p3       2     boroda 6
14     p4       2     boroda 7
14     p4       2     boroda 8

$data = $sth->fetchAll(PDO::FETCH_ASSOC | PDO::FETCH_GROUP, 2);

Expected result for $data:

Array
(
    [13] => Array
        (
             [p1] => Array
                   (
                         [0] => Array
                             (
                                [col3] => 1
                                [col4] => boroda
                             )
                         [1] => Array
                             (
                                [col3] => 1
                                [col4] => boroda 2
                             )
                         [2] => Array
                             (
                                [col3] => 2
                                [col4] => boroda 3
                             )
                        )
                    [p2] => Array
                        (
                         [0] => Array
                             (
                                [col3] => 2
                                [col4] => boroda 4
                             )
                         [1] => Array
                             (
                                [col3] => 2
                                [col4] => boroda 5
                             )
                   )
         )
    [14] => Array
        (
             [p3] => Array
                   (
                         [0] => Array
                             (
                                [col3] => 2
                                [col4] => boroda 6
                             )
                   )
             [p4] => Array
                   (
                         [0] => Array
                             (
                                [col3] => 2
                                [col4] => boroda 7
                             )
                         [1] => Array
                             (
                                [col3] => 2
                                [col4] => boroda 8
                             )

                   )
         )

--
Best Regards,
Mike Gavrilov.

--- End Message ---
--- Begin Message ---
Hi,
I'am very new to PHP, so please any comment is welcome.

I want to write a function in PHP, which takes X arguments and outputs a value. The functioning of this function should be stored in a db (mydb? or better alternatives?)
The function would look up the result in the db based on the X arguments.

But how can I store X arguments and the corresponding output value?
If I limit the X arguments to a specific number like N=10, then I could create N=10 +1 columns in a table.
But how should I do it if I don't want to limit myself to a fix number?

Thanks for any comment!
Ben

--- End Message ---
--- Begin Message ---
---------- Forwarded message ----------
From: Bastien Koert <phps...@gmail.com>
Date: Tue, May 10, 2011 at 4:37 PM
Subject: Re: [PHP] Storing indefinite arrays in database
To: Benedikt Voigt <benedikt.vo...@web.de>


On Tue, May 10, 2011 at 4:16 PM, Benedikt Voigt <benedikt.vo...@web.de> wrote:
> Hi,
> I'am very new to PHP, so please any comment is welcome.
>
> I want to write a function in PHP, which takes X arguments and outputs a
> value.
> The functioning of this function should be stored in a db (mydb? or better
> alternatives?)
> The function would look up the result in the db based on the X arguments.
>
> But how can I store X arguments and the corresponding output value?
> If I limit the X arguments to a specific number like N=10, then I could
> create N=10 +1 columns in a table.
> But how should I do it if I don't want to limit myself to a fix number?
>
> Thanks for any comment!
> Ben
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

My bad, copied only the OP not the list.


Create the DB to run in a vertical format

consider the horizontal style

record_id       field1   field2   field3   fieldN


which is great for fixed designs


The vertical format would be

record_id     attribute      argument




--

Bastien

Cat, the other other white meat



-- 

Bastien

Cat, the other other white meat

--- End Message ---

Reply via email to