On 9/28/2013 10:33 PM, Ethan Rosenberg wrote:
Dear List -
I have a working program. I made one change in a switch statement, and
it does not work. I'm probably missing something fundamental.
Here are some code SNIPPETS... [please note that all my debug
statements are at the left margin]
?php
session_start();
session_name(STORE);
set_time_limit(2400);
ini_set('display_errors', 'on');
ini_set('display_startup_errors', 'on');
error_reporting(-2);
ini_set('error_reporting', 'E_ALL | E_STRICT');
ini_set('html_errors', 'On');
On 09/28/2013 11:59 PM, Jim Giner wrote:
?php
session_start();
session_name(STORE);
set_time_limit(2400);
ini_set('display_errors', 'on');
ini_set('display_startup_errors', 'on');
error_reporting(-2);
ini_set('error_reporting', 'E_ALL | E_STRICT');
On 9/29/2013 1:29 AM, Ethan Rosenberg wrote:
On 09/28/2013 11:59 PM, Jim Giner wrote:
?php
session_start();
session_name(STORE);
set_time_limit(2400);
ini_set('display_errors', 'on');
ini_set('display_startup_errors', 'on');
error_reporting(-2);
On 9/29/2013 1:38 AM, Jim Giner wrote:
session_start();
session_name(STORE);
set_time_limit(2400);
ini_set('display_errors', 'on');
ini_set('display_startup_errors', 'on');
error_reporting(-2);
ini_set('error_reporting', 'E_ALL | E_STRICT');
-Original Message-
From: Maciek Sokolewicz [mailto:tula...@gmail.com] On Behalf Of
Maciek Sokolewicz
Sent: 11 March 2013 22:44
unless ( $a and $b )
=
if ( ! ($a and $b) )
So in simple terms, just stick a ! (or the keyword not) in front of
your
expression, and you'll have
2013/3/12 Ford, Mike m.f...@leedsmet.ac.uk
-Original Message-
From: Maciek Sokolewicz [mailto:tula...@gmail.com] On Behalf Of
Maciek Sokolewicz
Sent: 11 March 2013 22:44
unless ( $a and $b )
=
if ( ! ($a and $b) )
So in simple terms, just stick a ! (or the keyword
-Original Message-
From: Ford, Mike [mailto:m.f...@leedsmet.ac.uk]
Sent: 12 March 2013 10:51 AM
To: PHP General
Subject: RE: [PHP] Re: UNLESS Statement Equivalent
unless ( $a and $b )
=
if ( ! ($a and $b) )
So in simple terms, just stick a ! (or the keyword not) in front of
your
-Original Message-
From: Ford, Mike [mailto:m.f...@leedsmet.ac.uk]
Sent: 12 March 2013 10:51 AM
To: PHP General
Subject: RE: [PHP] Re: UNLESS Statement Equivalent
unless ( $a and $b )
=
if ( ! ($a and $b) )
So in simple terms, just stick a ! (or the keyword not) in front of
your
-Original Message-
From: Arno Kuhl [mailto:a...@dotcontent.net]
Sent: 12 March 2013 13:04
Mike, I presume you're saying the precedence of the Boolean keyword
operators is lower than the Boolean symbol operators, but if so then
wouldn't there be less need for the parentheses? I
On 11-3-2013 22:32, Angela Barone wrote:
I'm looking for an 'unless' statement, but as far as I can tell, PHP
doesn't have one. Hopefully someone can help me rewrite my statement.
In English, I want to say: always do something UNLESS these 3 conditions
are met.
The
On Nov 19, 2012, at 2:46 PM, Stuart Dallas stu...@3ft9.com wrote:
On 19 Nov 2012, at 19:35, Tim Streater t...@clothears.org.uk wrote:
On 18 Nov 2012 at 14:44, Jim Giner jim.gi...@albanyhandball.com wrote:
Just so. Perhaps those who are not grasping the point could re-read their
copy of
Hello,
I was just wondering after writting the code in version 2 here below, it turns
out in testing that it actually PHP is not validating the expressions instead
always I get the first case.
1.Using nested if statement {THE INTENDED BEHAVIOR}:
if ($count 14)
$boxes = 3;
At 07:10 AM 11/16/2012, Omar Muhsin wrote:
Hello,
I was just wondering after writting the code in version 2 here
below, it turns out in testing that it actually PHP is not
validating the expressions instead always I get the first case.
1.Using nested if statement {THE INTENDED BEHAVIOR}:
On Fri, 16 Nov 2012, Ken Robinson wrote:
At 07:10 AM 11/16/2012, Omar Muhsin wrote:
Hello,
I was just wondering after writting the code in version 2 here below, it
turns out in testing that it actually PHP is not validating the expressions
instead always I get the first case.
1.Using
On Sun, Jun 27, 2010 at 4:08 AM, Tanel Tammik keevit...@gmail.com wrote:
Hello,
how to select only if value is present?
$query = $db-query(select menus.id, menus.name,
case
when panels.id is not null then '1'
end as hiddenpanel
from . \DB_MENUS . as menus
On Monday 28 June 2010 09:49:55 Andrew Ballard wrote:
On Sun, Jun 27, 2010 at 4:08 AM, Tanel Tammik keevit...@gmail.com wrote:
Hello,
how to select only if value is present?
$query = $db-query(select menus.id, menus.name,
case
when panels.id is not null then '1'
On Sunday 27 June 2010 22:12:41 Brandon Rampersad wrote:
no
At least smack me and give us an explanation. :-)
--
Blessings,
David M.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Mon, Jun 28, 2010 at 10:27 AM, David McGlone da...@dmcentral.net wrote:
Tanel, we both learned something. I didn't fully understand join myself yet,
but I think I do now.
but let me ask this if the join wasn't there would an if statement like I
mentioned have worked?
Blessings,
David M.
On Monday 28 June 2010 11:14:53 Andrew Ballard wrote:
On Mon, Jun 28, 2010 at 10:27 AM, David McGlone da...@dmcentral.net wrote:
Tanel, we both learned something. I didn't fully understand join myself
yet, but I think I do now.
but let me ask this if the join wasn't there would an if
On Sunday 27 June 2010 04:08:24 Tanel Tammik wrote:
Hello,
how to select only if value is present?
$query = $db-query(select menus.id, menus.name,
case
when panels.id is not null then '1'
end as hiddenpanel
from . \DB_MENUS . as menus
left join
no
On Sun, Jun 27, 2010 at 8:29 PM, David McGlone da...@dmcentral.net wrote:
On Sunday 27 June 2010 04:08:24 Tanel Tammik wrote:
Hello,
how to select only if value is present?
$query = $db-query(select menus.id, menus.name,
case
when panels.id is not null then
Hello,
I've got a form with three fields that are not required for proper
completion of it, ending month, day, year fields. If a user enters
nothing no problem, but if those form fields are entered I need them
validated. They have to be in the correct format -MM-DD date
format and that value
On Mon, 2010-06-07 at 16:51 -0400, David Mehler wrote:
Hello,
I've got a form with three fields that are not required for proper
completion of it, ending month, day, year fields. If a user enters
nothing no problem, but if those form fields are entered I need them
validated. They have to be
David Mehler wrote:
Hello,
I've got a form with three fields that are not required for proper
completion of it, ending month, day, year fields. If a user enters
nothing no problem, but if those form fields are entered I need them
validated. They have to be in the correct format -MM-DD
2010/4/16 Adam Richardson simples...@gmail.com:
On Thu, Apr 15, 2010 at 5:55 PM, Jason Pruim
li...@pruimphotography.comwrote:
On Apr 15, 2010, at 8:55 AM, tedd wrote:
At 4:13 PM -0400 4/14/10, Al wrote:
Incidentally, about formatting scripts, one of the reasons I like phpEdit
is that
Jan G.B. wrote:
2010/4/16 Adam Richardson simples...@gmail.com:
On Thu, Apr 15, 2010 at 5:55 PM, Jason Pruim li...@pruimphotography.comwrote:
On Apr 15, 2010, at 8:55 AM, tedd wrote:
At 4:13 PM -0400 4/14/10, Al wrote:
Incidentally, about formatting scripts, one of the reasons I like
At 9:06 AM -0400 4/16/10, Robert Cummings wrote:
It runs in a terminal!
Cheers,
Rob.
That's not good. Airport security frowns on that.
Cheers,
tedd
--
---
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To
tedd wrote:
At 9:06 AM -0400 4/16/10, Robert Cummings wrote:
It runs in a terminal!
Cheers,
Rob.
That's not good. Airport security frowns on that.
Cheers,
tedd
Mac users might get a little upset if Airport security doesn't allow them to use
their terminals to run
--
Jim Lucas
At 4:13 PM -0400 4/14/10, Al wrote:
Incidentally, about formatting scripts, one of the reasons I like
phpEdit is that it has a terrific code beautifier. You can set it
for phpDoc or Pear rendering. And, it auto indents, etc. as you
enter stuff.
Al...
Unfortunately, there is no
On Thu, Apr 15, 2010 at 8:55 AM, tedd tedd.sperl...@gmail.com wrote:
At 4:13 PM -0400 4/14/10, Al wrote:
Incidentally, about formatting scripts, one of the reasons I like phpEdit
is that it has a terrific code beautifier. You can set it for phpDoc or
Pear rendering. And, it auto indents,
On Thu, 2010-04-15 at 08:55 -0400, tedd wrote:
At 4:13 PM -0400 4/14/10, Al wrote:
Incidentally, about formatting scripts, one of the reasons I like
phpEdit is that it has a terrific code beautifier. You can set it
for phpDoc or Pear rendering. And, it auto indents, etc. as you
enter
On Apr 15, 2010, at 8:55 AM, tedd wrote:
At 4:13 PM -0400 4/14/10, Al wrote:
Incidentally, about formatting scripts, one of the reasons I like
phpEdit is that it has a terrific code beautifier. You can set it
for phpDoc or Pear rendering. And, it auto indents, etc. as you
enter stuff.
On Apr 15, 2010, at 9:24 AM, Ashley Sheridan wrote:
On Thu, 2010-04-15 at 08:55 -0400, tedd wrote:
Have you tried Coder on the Mac? Most developers I know who use Macs
(it's not the oxymoron it sounds! :p )
Most Mac people would say the morons use Windows ;) But that's
another story
On Thu, Apr 15, 2010 at 5:55 PM, Jason Pruim li...@pruimphotography.comwrote:
On Apr 15, 2010, at 8:55 AM, tedd wrote:
At 4:13 PM -0400 4/14/10, Al wrote:
Incidentally, about formatting scripts, one of the reasons I like phpEdit
is that it has a terrific code beautifier. You can set it
At 10:04 PM +0100 4/13/10, Nathan Rixham wrote:
Robert Cummings wrote:
Nathan Rixham wrote:
Fail on that last one. -1 is not equivalent to FALSE :B
well that's one job I'm not getting :p
cheers for the picking that one up Rob
And that's the reason why I hate test like that!
The short
At 5:06 PM -0400 4/13/10, Robert Cummings wrote:
Nathan Rixham wrote:
well that's one job I'm not getting :p
Well you DID get 66.7%. I've met coders that would stare at the
answer and still not understand :D
Cheers,
Rob.
Well.. count me among those staring. I just don't get those type
tedd wrote:
At 5:06 PM -0400 4/13/10, Robert Cummings wrote:
Nathan Rixham wrote:
well that's one job I'm not getting :p
Well you DID get 66.7%. I've met coders that would stare at the
answer and still not understand :D
Cheers,
Rob.
Well.. count me among those staring. I just don't get
I'm new to programming, drive a truck in the day, now taking night courses
to get a better job for my family. Please bear with me if this is a dumb
question, I don't have much experience.
I'm taking a night class in HTML and PHP and can't figure out a problem and
can't find the answer in the
On Tue, 2010-04-13 at 12:04 -0400, steve_r wrote:
I'm new to programming, drive a truck in the day, now taking night courses
to get a better job for my family. Please bear with me if this is a dumb
question, I don't have much experience.
I'm taking a night class in HTML and PHP and can't
steve_r wrote:
I'm new to programming, drive a truck in the day, now taking night courses
to get a better job for my family. Please bear with me if this is a dumb
question, I don't have much experience.
I'm taking a night class in HTML and PHP and can't figure out a problem and
can't find the
Okay, I understand now, true/false is better, now it makes sense why it's
always hitting the case it hits. Thank you Ashley.
At 12:04 PM -0400 4/13/10, steve_r wrote:
I'm new to programming, drive a truck in the day, now taking night courses
to get a better job for my family. Please bear with me if this is a dumb
question, I don't have much experience.
-snip-
Sorry for the basic question.
Steve Reilly
Steve:
Robert Cummings wrote:
steve_r wrote:
I'm new to programming, drive a truck in the day, now taking night
courses
to get a better job for my family. Please bear with me if this is a dumb
question, I don't have much experience.
I'm taking a night class in HTML and PHP and can't figure out a
Nathan Rixham wrote:
Robert Cummings wrote:
steve_r wrote:
I'm new to programming, drive a truck in the day, now taking night
courses
to get a better job for my family. Please bear with me if this is a dumb
question, I don't have much experience.
I'm taking a night class in HTML and PHP and
Robert Cummings wrote:
Nathan Rixham wrote:
Robert Cummings wrote:
steve_r wrote:
I'm new to programming, drive a truck in the day, now taking night
courses
to get a better job for my family. Please bear with me if this is a
dumb
question, I don't have much experience.
I'm taking a
Nathan Rixham wrote:
Robert Cummings wrote:
Nathan Rixham wrote:
Robert Cummings wrote:
steve_r wrote:
I'm new to programming, drive a truck in the day, now taking night
courses
to get a better job for my family. Please bear with me if this is a
dumb
question, I don't have much experience.
Robert Cummings wrote:
Nathan Rixham wrote:
Robert Cummings wrote:
Nathan Rixham wrote:
Robert Cummings wrote:
steve_r wrote:
I'm new to programming
function check_it2($val) {
echo gettype($val);
switch($val) {
case($val 0 ):
echo Switch greater than 0;
Nathan Rixham wrote:
Robert Cummings wrote:
Nathan Rixham wrote:
Robert Cummings wrote:
Nathan Rixham wrote:
Robert Cummings wrote:
steve_r wrote:
I'm new to programming
function check_it2($val) {
echo gettype($val);
switch($val) {
case($val 0 ):
echo Switch
Robert Cummings wrote:
Nathan Rixham wrote:
Robert Cummings wrote:
Nathan Rixham wrote:
Robert Cummings wrote:
Nathan Rixham wrote:
Robert Cummings wrote:
steve_r wrote:
I'm new to programming
function check_it2($val) {
echo gettype($val);
switch($val) {
case($val 0
I'm trying to take a paragraph then break it into linebreaks and grab each
line separately but it's not working, I can get the paragraph but my lines
are not I get the object id #6 or #7 everytime
Here's my code
// grab all the paragraphs on the page
$xpath = new DOMXPath($dom);
//$graphs =
I'm in the process of seperating logic from display in a section of code,
and wanted to make sure I wasn't treading on a performance landmine here, so
I ask you wizened masters of the dark arts this...
is there a serious performance hit, or reason not to use long, ie more than
30 - 40 lines,
...
Wouldn't have thought so. But for readability, you may find this a
little easier instead:
?
{$var1} Blah {$var2}
...
?php
--
Richard Heyes
HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.org (Updated January 31st)
--
PHP General Mailing List
In my opinion, you would achieve better results using a template
engine, like Smarty (http://www.smarty.net/). In addition, your code
would be entirely separated from presentation in a elegant way.
2009/2/6 Frank Stanovcak blindspot...@comcast.net:
I'm in the process of seperating logic from
Wouldn't have thought so. But for readability, you may find this a
little easier instead:
Slight correction:
?
?=$var1? blah ?=var2?
?php
--
Richard Heyes
HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.org (Updated January 31st)
--
PHP General Mailing
Richard Heyes rich...@php.net wrote in message
news:af8726440902060918v6d2f1ee1ia3f839189874...@mail.gmail.com...
Wouldn't have thought so. But for readability, you may find this a
little easier instead:
Slight correction:
?
?=$var1? blah ?=var2?
?php
--
Richard Heyes
HTML5
Bruno Fajardo bsfaja...@gmail.com wrote in message
news:eeb6980b0902060915k2b34ec31nc6ad166e2c544...@mail.gmail.com...
In my opinion, you would achieve better results using a template
engine, like Smarty (http://www.smarty.net/). In addition, your code
would be entirely separated from
2009/2/6 Frank Stanovcak blindspot...@comcast.net:
Richard Heyes rich...@php.net wrote in message
news:af8726440902060918v6d2f1ee1ia3f839189874...@mail.gmail.com...
Wouldn't have thought so. But for readability, you may find this a
little easier instead:
Slight correction:
?
?=$var1?
On Fri, Feb 6, 2009 at 12:15 PM, Bruno Fajardo bsfaja...@gmail.com wrote:
In my opinion, you would achieve better results using a template
engine, like Smarty (http://www.smarty.net/). In addition, your code
would be entirely separated from presentation in a elegant way.
2009/2/6 Frank
Well, Smarty's caching layer is very fast. Maybe not as fast as an
echo statement, but apparentely Frank was also interested in separate
logic from presentation, and a series of echo's is not the best
solution in my opinion. :-)
But the best solution depends of the context of the application, i
On Fri, Feb 6, 2009 at 1:43 PM, Bruno Fajardo bsfaja...@gmail.com wrote:
Well, Smarty's caching layer is very fast. Maybe not as fast as an
echo statement, but apparentely Frank was also interested in separate
logic from presentation, and a series of echo's is not the best
solution in my
I am so stick to Smarty that I never tried other solutions, like
Savant. Thanks for the tip, I'll try it right away.
Cheers.
2009/2/6 Eric Butera eric.but...@gmail.com:
On Fri, Feb 6, 2009 at 1:43 PM, Bruno Fajardo bsfaja...@gmail.com wrote:
Well, Smarty's caching layer is very fast. Maybe not
On Fri, Feb 6, 2009 at 2:10 PM, Bruno Fajardo bsfaja...@gmail.com wrote:
I am so stick to Smarty that I never tried other solutions, like
Savant. Thanks for the tip, I'll try it right away.
Cheers.
2009/2/6 Eric Butera eric.but...@gmail.com:
On Fri, Feb 6, 2009 at 1:43 PM, Bruno Fajardo
On Fri, Feb 06, 2009 at 01:09:13PM -0500, Eric Butera wrote:
On Fri, Feb 6, 2009 at 12:15 PM, Bruno Fajardo bsfaja...@gmail.com wrote:
In my opinion, you would achieve better results using a template
engine, like Smarty (http://www.smarty.net/). In addition, your code
would be entirely
Stuart stut...@gmail.com wrote in message
news:a5f019de0902060932k1ccf2948ua42f3cfa33694...@mail.gmail.com...
2009/2/6 Frank Stanovcak blindspot...@comcast.net:
Richard Heyes rich...@php.net wrote in message
news:af8726440902060918v6d2f1ee1ia3f839189874...@mail.gmail.com...
Wouldn't have
On Fri, 2009-02-06 at 17:32 +, Stuart wrote:
They're called short tags, not fast tags. There is nothing faster
about them beyond the typing effort required.
Mostly true.
However, the only thing that ?= ? does is an echo/print, so aside
from saving you ?php echo $foo; ? all the time, you
On Friday 06 February 2009 19:12:08 Frank Stanovcak wrote:
I'm in the process of seperating logic from display in a section of code,
and wanted to make sure I wasn't treading on a performance landmine here,
so I ask you wizened masters of the dark arts this...
is there a serious performance
I have been reading this thread with interest ... and amusement.
FWII for my web sites I have
1) Most PHP code in files outside of the document root
2) Site specific variables (constants, really) in an include.php file
3) All HTML is also in this include file and is the content a variable.
4)
tedd tedd.sperl...@gmail.com wrote in message
news:p06240801c5aa0ed7d...@[192.168.1.101]...
At 4:16 PM +0100 1/30/09, Jochem Maas wrote:
tedd schreef:
At 4:43 PM -0500 1/29/09, Frank Stanovcak wrote:
yes...that is legal. as long as the statment resolves to a boolean it
will
work.
At 4:16 PM +0100 1/30/09, Jochem Maas wrote:
tedd schreef:
At 4:43 PM -0500 1/29/09, Frank Stanovcak wrote:
yes...that is legal. as long as the statment resolves to a boolean it
will
work. It's not technically correct, but it does work.
There you go again. What's technically
At 4:43 PM -0500 1/29/09, Frank Stanovcak wrote:
yes...that is legal. as long as the statment resolves to a boolean it will
work. It's not technically correct, but it does work.
There you go again. What's technically correct?
Cheers,
tedd
--
---
http://sperling.com
tedd schreef:
At 4:43 PM -0500 1/29/09, Frank Stanovcak wrote:
yes...that is legal. as long as the statment resolves to a boolean it
will
work. It's not technically correct, but it does work.
There you go again. What's technically correct?
hiya tedd,
you mean to ask not technically
Alice Wei aj...@alumni.iu.edu wrote in message
news:snt101-w587cd616331fc59b84834af0...@phx.gbl...
Hi,
I have a code snippet here as in the following:
//Switch statements between the four options
switch($string) {
case :
$string= NOT book.author='All';
break;
default:
$string= $string . AND
I was wondering if anyone sees something I am bypassing:
I have this sample code that works in another server:
?php
function getClientFullName($dbh,$id){
// die(var_dump($dbh));
$sql = SELECT * FROM Clients WHERE Id=.$id;
// die(print $sql);
$sthr = $dbh-query($sql);
//
NEWBIE! I have some GET data coming from a previous search form.
How do I add the WHERE part ?
orig:
$query_get1 = SELECT p_First, p_id, p_Last, p_Lvl, p_Sel
FROM contacts;
--W / WHERE...???
$query_get1 = SELECT p_First, p_id, p_Last, p_Lvl, p_Sel
FROM contacts
WHERE p_First like
On Wed, 2008-04-23 at 19:07 -0700, revDAVE wrote:
NEWBIE! I have some GET data coming from a previous search form.
How do I add the WHERE part ?
orig:
$query_get1 = SELECT p_First, p_id, p_Last, p_Lvl, p_Sel
FROM contacts;
--W / WHERE...???
$query_get1 = SELECT p_First, p_id,
Thank you everybody for these great tips!
--
Thanks - RevDave
Cool7 @ hosting4days . com
[db-lists]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello Folks,
I would like to be able to wrap a 'form' inside a php 'if statement' - so
that the form will appear if the 'if condition' is met.
- most likely I cannot have a ?php tag inside another one - and am sure
I'm doing other things wrong also...
- now I get the error - Parse error
On Fri, Mar 14, 2008 at 7:56 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hello Folks,
I would like to be able to wrap a 'form' inside a php 'if statement' - so
that the form will appear if the 'if condition' is met.
- most likely I cannot have a ?php tag inside another one - and am
On Fri, Mar 14, 2008 at 7:56 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hello Folks,
I would like to be able to wrap a 'form' inside a php 'if statement' - so
that the form will appear if the 'if condition' is met.
- most likely I cannot have a ?php tag inside another one - and am
On Jun 19, 2007, at 5:10 PM, Roberto Mansfield wrote:
Jason Pruim wrote:
Okay, so I have a question... Probably pretty easy, but why would
my if
statement show more records then what are in the database?
if($row[5] =='Level4'){ // White Highlight
}// End of Level 4
else
Jason Pruim wrote:
Okay, so I have a question... Probably pretty easy, but why would my if
statement show more records then what are in the database?
if($row[5] =='Level4'){ // White Highlight
}// End of Level 4
else
{// Green Highlight
}// End of
It will probably work, and you could find out for sure by just trying it.
It might be better to construct a single query using things like:
$company_ids = implode(', ', $_POST['reporton_company']);
$query .= WHERE company_id IN ($company_ids) ;
This presumes you have already validated the
Have been wondering if this is possible
Basically I have 3 posted arrays,
$_POST['reporton_company'] (this can be various company id's. ie 3,6,7)
$_POST['report_period'] (this can be various periods but a max of 4
submitted. ie 3,4,5)
$_POST['questions_groups'] (this can be various -
foreach($_POST['reporton_company'] as $cmp_ind =$arrayd_cmp_id) {
foreach($_POST['report_period'] as $rep_ind =$arrayd_per_id) {
foreach($_POST['questions_groups'] as $group_ind =
$arrayd_group_no) {
mysql_select_db($database_name, $dname);
Why
Alex Major wrote:
Hi list.
Basically, I'm still learning new things about php and I was wondering if
things inside an if statement get 'looked at' by a script if the condition
is false.
For example, would this mysql query get executed if $number = 0 ?
If ($number == 1) {
mysql_query($blah)
hi,
can someone tell me how to do this:
i have to retrive data from a mysql table let's sayTABLE . i have to
check that the rows i retrive meet this condition:
field1='$variable',field2 is false and field3 is also false. as you
can see field2 and field3 are bool type. field1 is varchar. i did
[snip]
can someone tell me how to do this:
i have to retrive data from a mysql table let's sayTABLE . i have to
check that the rows i retrive meet this condition:
field1='$variable',field2 is false and field3 is also false. as you
can see field2 and field3 are bool type. field1 is varchar. i
Hi everyone
Quick question:
If I have such a loop:
?
for($i=0;$i100;$i++) {
if($i==100) {
// do something special for this occurence
}
// do something standard
}
?
In this case it seems such a waste that the if() statement is done 99
times when it's not needed. Is there any
To: php-general@lists.php.net
Subject: [PHP] Unnecessary if statement? Programming technique
Hi everyone
Quick question:
If I have such a loop:
?
for($i=0;$i100;$i++) {
if($i==100) {
}
// do something standard
}
?
In this case it seems such a waste
Jared Williams wrote:
Why not
for ($i = 0; $i 100/100; ++$i)
This involves dividing 100 by 100 for each iteration of the loop.
It would be better to test against 1.
There is also the unwanted side-effect of executing the code on each
hundredth iteration, which is unwanted (as
Hi,
David is right about the unwanted side-effect. Thanks for the idea though.
Unfortunately the 'greater problem' is not so great, I've just been doing
this for a while now and find myself programming loops like these so often
and I've never got round to testing if a simple IF statement is a
Hi,
I imagine this kind of thing is not especially taxing on the processor,
especially if the condition is a fairly simple comparison. That said, I
have very little understanding aside from my own limited experience of
what runs slowly!
If you're worried about code maintenance, then move the
This is probably going to sound strange, but I like to try to think outside the
box (buzzphrase!) and hit things at odd angles.
Would someone care to test (or already know) the performance difference between
a for loop and a foreach loop?
Or the performance difference over many iterations of
Hi there!
I guess this is off-topic? but I want to know if this is
possible. (If
there's anyone out there that have a solution, I would appreciate it
though)
I want to know if there is anyway of showing tables in PHP
in an order
like this in a single SQL-statement...
Hi there!
I guess this is off-topic? but I want to know if this is possible. (If
there's anyone out there that have a solution, I would appreciate it
though)
I want to know if there is anyway of showing tables in PHP in an order
like this in a single SQL-statement...
Table is like this:
select ... from ... ORDER BY (IDCategory = 4) DESC,
IDCategory = 4 will return 1 or 0, for 4 or not 4.
1 is bigger than 0, in most countries. :-)
On Mon, April 18, 2005 2:50 pm, Gustav Wiberg said:
Hi there!
I guess this is off-topic? but I want to know if this is possible. (If
there's
Jacques wrote:
How should I formulate my sql statement to create a result set of members
who registered between now and 7 days ago?
I have tried the following and it is obviously incorrect:
$sqlnewmembers = Select uid, uprofilename from tblusers where udatereg
between (date() and date()
Try a MySQL list. Or possibly even php-db.
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
reason it seems to always be true, ... something i'm doing wrong? btw, i
cannot add the in_array to the statement because if the $buddylist is empty
it will generate errors because of the empty implode.
you could add the is_array() check.
$buddylist = preg_split('/( )+/',
1 - 100 of 186 matches
Mail list logo