On 11 Oct 2011 at 03:03, Paul M Foster pa...@quillandmouse.com wrote:
On Mon, Oct 10, 2011 at 04:14:00PM +0100, Tim Streater wrote:
I would like to use the SQLite3 (not PDO) interface to SQLite, and I
would like to be able to supply a string containing several SQL
statements and have them
Tim Streater wrote:
On 11 Oct 2011 at 03:03, Paul M Foster pa...@quillandmouse.com wrote:
On Mon, Oct 10, 2011 at 04:14:00PM +0100, Tim Streater wrote:
I would like to use the SQLite3 (not PDO) interface to SQLite, and I
would like to be able to supply a string containing several SQL
On 11 Oct 2011 at 10:47, David Robley robl...@aapt.net.au wrote:
Tim Streater wrote:
On 11 Oct 2011 at 03:03, Paul M Foster pa...@quillandmouse.com wrote:
On Mon, Oct 10, 2011 at 04:14:00PM +0100, Tim Streater wrote:
I would like to use the SQLite3 (not PDO) interface to SQLite, and I
Tim Streater wrote:
On 11 Oct 2011 at 10:47, David Robley robl...@aapt.net.au wrote:
Tim Streater wrote:
On 11 Oct 2011 at 03:03, Paul M Foster pa...@quillandmouse.com wrote:
On Mon, Oct 10, 2011 at 04:14:00PM +0100, Tim Streater wrote:
I would like to use the SQLite3 (not PDO)
On 11 Oct 2011 at 11:25, David Robley robl...@aapt.net.au wrote:
Tim Streater wrote:
On 11 Oct 2011 at 10:47, David Robley robl...@aapt.net.au wrote:
Tim Streater wrote:
On 11 Oct 2011 at 03:03, Paul M Foster pa...@quillandmouse.com wrote:
On Mon, Oct 10, 2011 at 04:14:00PM +0100, Tim
I would like to use the SQLite3 (not PDO) interface to SQLite, and I would like
to be able to supply a string containing several SQL statements and have them
all executed, thus saving the overhead of several calls. It *appears* that this
may be how it actually works, but I wondered if anyone
On Mon, Oct 10, 2011 at 04:14:00PM +0100, Tim Streater wrote:
I would like to use the SQLite3 (not PDO) interface to SQLite, and I
would like to be able to supply a string containing several SQL
statements and have them all executed, thus saving the overhead of
several calls. It *appears*
Hi,
your function could be condensed to this:
function check($a)
{
return is_array($a) ? true : false;
}
Or even better, this:
function check($a)
{
return is_array($a);
}
Not that I'd imagine it makes a great deal of difference.
--
Richard Heyes
HTML5 graphing: RGraph
I tend to put my return value in a variable and at the end of the
function I have 1 return statement.
I have seen others doing returns in the middle of the function.
Example how I do it:
function check($a) {
$return='';
if ( is_array( $a ) ) {
$return='Array';
} else {
$return='Not
Peter van der Does wrote:
I tend to put my return value in a variable and at the end of the
function I have 1 return statement.
I have seen others doing returns in the middle of the function.
Example how I do it:
function check($a) {
$return='';
if ( is_array( $a ) ) {
On Thu, Apr 23, 2009 at 8:25 AM, Per Jessen p...@computer.org wrote:
Peter van der Does wrote:
I tend to put my return value in a variable and at the end of the
function I have 1 return statement.
I have seen others doing returns in the middle of the function.
Example how I do it:
function
On Thu, Apr 23, 2009 at 08:12:47AM -0400, Peter van der Does wrote:
I tend to put my return value in a variable and at the end of the
function I have 1 return statement.
I have seen others doing returns in the middle of the function.
Example how I do it:
function check($a) {
$return='';
tedd tedd.sperl...@gmail.com wrote in message
news:p06240805c6161613a...@[192.168.1.101]...
At 8:12 AM -0400 4/23/09, Peter van der Does wrote:
I tend to put my return value in a variable and at the end of the
function I have 1 return statement.
I have seen others doing returns in the middle of
George Larson wrote:
That's an interesting subject that I've never considered.
I usually return immediately. For me, it makes the code easier to
read. I work with a number of other coders here and, if the result
isn't returned then I have to keep reading through the code to make
sure
At 8:12 AM -0400 4/23/09, Peter van der Does wrote:
I tend to put my return value in a variable and at the end of the
function I have 1 return statement.
I have seen others doing returns in the middle of the function.
-snip-
What is your take? And is there any benefit to either method?
Peter
Hi,
while(true){
Yikes.
Personally, I'd put the return value wherever it will make the code
easier to read. If you're checking what has been passed as arguments,
and one of them is wrong, I think there's little point in continuing,
so an immediate return is the order of the day. Though with
2009/4/23 Tony Marston t...@marston-home.demon.co.uk:
tedd tedd.sperl...@gmail.com wrote in message
news:p06240805c6161613a...@[192.168.1.101]...
At 8:12 AM -0400 4/23/09, Peter van der Does wrote:
I tend to put my return value in a variable and at the end of the
function I have 1 return
Richard Heyes wrote:
Hi,
while(true){
Yikes.
Personally, I'd put the return value wherever it will make the code
easier to read. If you're checking what has been passed as arguments,
and one of them is wrong, I think there's little point in continuing,
so an immediate return is the
At 2:19 PM +0100 4/23/09, Tony Marston wrote:
tedd tedd.sperl...@gmail.com wrote in message
It's called Structured programming -- one way in and one way out of a
function.
There are, of course, exceptions where it might help others reviewing your
code to see what's going on, such as
On Thu, 2009-04-23 at 10:14 -0400, tedd wrote:
At 2:19 PM +0100 4/23/09, Tony Marston wrote:
tedd tedd.sperl...@gmail.com wrote in message
It's called Structured programming -- one way in and one way out of a
function.
There are, of course, exceptions where it might help others
On Thu, Apr 23, 2009 at 10:14:28AM -0400, tedd wrote:
At 2:19 PM +0100 4/23/09, Tony Marston wrote:
snip
There is no such rule, it is a matter of personal preference. As a
previous poster has already said, if you want to leave a function early
and
ignore all subsequent processing it is
At 10:25 AM -0400 4/23/09, Robert Cummings wrote:
On Thu, 2009-04-23 at 10:14 -0400, tedd wrote:
However, I am saying (after years of reading other people's code) it
is generally much easier to read code that follows Structured
Programming than it is to read code that doesn't.
Actually I
At 11:07 PM -0600 6/29/06, John Meyer wrote:
Larry Garfield wrote:
switch is fine if your elseif comparisons are equality based. If they're not
equality based, then they don't map to switch as well.
In other words, if you look at a logical ladder as the roots of the tree, as
long as each root
On 6/30/06, tedd [EMAIL PROTECTED] wrote:
At 11:07 PM -0600 6/29/06, John Meyer wrote:
Larry Garfield wrote:
switch is fine if your elseif comparisons are equality based. If they're not
equality based, then they don't map to switch as well.
Not true. I've come to really appreciate the
On 30 June 2006 13:37, tedd wrote:
At 11:07 PM -0600 6/29/06, John Meyer wrote:
Larry Garfield wrote:
switch is fine if your elseif comparisons are equality
based. If they're not equality based, then they don't map to
switch as well.
In other words, if you look at a logical
On Thu, June 29, 2006 11:07 pm, Larry Garfield wrote:
switch is fine if your elseif comparisons are equality based. If
they're not
equality based, then they don't map to switch as well.
Except in PHP which supports:
switch(TRUE) {
case _boolean_expression_:
break;
}
So you can have case
At 4:26 PM +0100 6/30/06, Ford, Mike wrote:
On 30 June 2006 13:37, tedd wrote:
At 11:07 PM -0600 6/29/06, John Meyer wrote:
Larry Garfield wrote:
[1] switch is fine if your elseif comparisons are equality
based. If they're not equality based, then they don't map to
switch as well.
On 29 June 2006 01:03, David Tulloh wrote:
I'm also going to throw in an elseif for fun, to get this (hopefully)
improved version:
if($row[1] == none) {
print(tr);
print(td$row[0] $row[2]/td);
print(/tr);
} elseif($row[1] == $row[2]) {
print(tr);
print(td$row[0]
At 8:15 PM -0400 6/28/06, Robert Cummings wrote:
On Wed, 2006-06-28 at 20:02, David Tulloh wrote:
Grae Wolfe - PHP wrote:
...
want. Any help would be great!
-snip- if/elseif -snip-
holy war id=opinion
Whenever you need a elseif, then it's time to consider a switch -- like thus:
print(
On Thursday 29 June 2006 06:51, tedd wrote:
At 8:15 PM -0400 6/28/06, Robert Cummings wrote:
On Wed, 2006-06-28 at 20:02, David Tulloh wrote:
Grae Wolfe - PHP wrote:
...
want. Any help would be great!
-snip- if/elseif -snip-
holy war id=opinion
Whenever you need a elseif,
Larry Garfield wrote:
switch is fine if your elseif comparisons are equality based. If they're not
equality based, then they don't map to switch as well.
In other words, if you look at a logical ladder as the roots of the
tree, as long as each root has the same number of forks (say each
I have a table with lots of fun information in it. For one of the pages
that I am working on, I want to display a list of names based on what is in
the DB.
My $SQL statement works great and has pulled in values for first_name,
hs_last_name, and last_name in that order. Right now, I am just
Grae Wolfe - PHP wrote:
...
want. Any help would be great!
if($row[1]=none) {
print(tr);
print(td$row[0] $row[2]/td);
print(/tr);
} else
if($row[1]=$row[2]) {
print(tr);
print(td$row[0] $row[2]/td);
print(/tr);
} else
print(tr);
print(td$row[0]
On Wed, 2006-06-28 at 20:02, David Tulloh wrote:
Grae Wolfe - PHP wrote:
...
want. Any help would be great!
if($row[1]=none) {
print(tr);
print(td$row[0] $row[2]/td);
print(/tr);
} else
if($row[1]=$row[2]) {
print(tr);
print(td$row[0] $row[2]/td);
At 04:38 PM 6/28/2006, Grae Wolfe - PHP wrote:
The first problem is men's names and unmarried women's names... they will
have the same hs_last_name and last_name so I don't want the duplicate
displaying on the page.
The second problem is the entry of the word none by some of the visitors
in
35 matches
Mail list logo