Mike,
$results[] will automatically push a value unto the end of an array.
So doing this...
--
$magic = array();
$magic[] = 'a';
$magic[] = 'b';
$magic[] = 'c';
-
is exactly this same as doing this...
--
$normal = array();
$normal[0] = 'a';
$normal[1] = 'b';
$normal[2] = 'c';
-
I have the following code:
$query = "SELECT * FROM classics";
$result = mysql_query($query);
if (!$result) die ("Database access failed: " . mysql_error());
$rows = mysql_num_rows($result);
for ($j = 0 ; $j < $rows ; ++$j)
{
$results[] = mysql_fetch_array($result);
}
mysql_close($db_server
At 9:04 PM +0100 9/24/10, Ashley Sheridan wrote:
I don't often use this type of logic, but I have used it before and
it's served me well. Essentially, a switch is a glorified if
statement, and I find them a lot nicer to read and write than a
series of if/elseif blocks.
Thanks,
Ash
Ash:
Exa
At 3:54 PM -0400 9/24/10, Bob McConnell wrote:
From: tedd
At 2:23 PM -0400 9/24/10, Bob McConnell wrote:
>>A switch works when a single test can dispatch all possible branches.
If
you have a series of tests where each looks for a different subset of
>>conditions, you need an elseif.
On 9/24/2010 9:49 AM, chris h wrote:
> "Gang of Four"
>
> http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612
>
> An excellent book on OOP.
>
> Chris H.
>
>
> On Fri, Sep 24, 2010 at 9:34 AM, Bob McConnell wrote:
>
>> From: chris h
>>
>>> On Fri, Sep 24, 201
5 matches
Mail list logo