Re: [PHP] function array problem

2009-02-18 Thread Ashley Sheridan
On Wed, 2009-02-18 at 10:21 -0600, Shawn McKenzie wrote: > Thodoris wrote: > > > >> I've had a bit of a problem with a function I'm using for a form. > >> Essentially, the function looks like this: > >> > >> function addEvent($values = Array('name' => '', 'venue' => '', > >> 'description' => '', '

Re: [PHP] function array problem

2009-02-18 Thread Shawn McKenzie
Thodoris wrote: > >> I've had a bit of a problem with a function I'm using for a form. >> Essentially, the function looks like this: >> >> function addEvent($values = Array('name' => '', 'venue' => '', >> 'description' => '', 'errors' => Array())) >> { >> // code here displays the form >> } >>

Re: [PHP] function array problem

2009-02-18 Thread Thodoris
I've had a bit of a problem with a function I'm using for a form. Essentially, the function looks like this: function addEvent($values = Array('name' => '', 'venue' => '', 'description' => '', 'errors' => Array())) { // code here displays the form } The function is used to both display an

Re: [PHP] function array problem

2009-02-17 Thread Eric Butera
On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan wrote: > I've had a bit of a problem with a function I'm using for a form. > Essentially, the function looks like this: > > function addEvent($values = Array('name' => '', 'venue' => '', > 'description' => '', 'errors' => Array())) > { >// code

Re: [PHP] function array problem

2009-02-17 Thread Shawn McKenzie
Andrew Ballard wrote: > On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan > wrote: >> I've had a bit of a problem with a function I'm using for a form. >> Essentially, the function looks like this: >> >> function addEvent($values = Array('name' => '', 'venue' => '', >> 'description' => '', 'errors'

Re: [PHP] function array problem

2009-02-17 Thread Ashley Sheridan
On Tue, 2009-02-17 at 20:35 +, Lewis Wright wrote: > What about: > > > function addEvent($values='') > { > !is_array($values) && $values = Array('name' => '', 'venue' => '', > 'description' =>'', > 'errors' => Array()); > > //rest of the code > > } > > It's nice and sort. > > 2009/2/17 A

Re: [PHP] function array problem

2009-02-17 Thread Lewis Wright
What about: function addEvent($values='') { !is_array($values) && $values = Array('name' => '', 'venue' => '', 'description' =>'', 'errors' => Array()); //rest of the code } It's nice and sort. 2009/2/17 Ashley Sheridan : > On Tue, 2009-02-17 at 15:21 -0500, Andrew Ballard wrote: >> On Tue,

Re: [PHP] function array problem

2009-02-17 Thread Ashley Sheridan
On Tue, 2009-02-17 at 15:21 -0500, Andrew Ballard wrote: > On Tue, Feb 17, 2009 at 3:29 PM, Ashley Sheridan > wrote: > > On Tue, 2009-02-17 at 15:13 -0500, Bastien Koert wrote: > >> On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan > >> wrote: > >> > >> > I've had a bit of a problem with a function

Re: [PHP] function array problem

2009-02-17 Thread Ashley Sheridan
On Tue, 2009-02-17 at 15:19 -0500, Andrew Ballard wrote: > On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan > wrote: > > I've had a bit of a problem with a function I'm using for a form. > > Essentially, the function looks like this: > > > > function addEvent($values = Array('name' => '', 'venue'

Re: [PHP] function array problem

2009-02-17 Thread Andrew Ballard
On Tue, Feb 17, 2009 at 3:29 PM, Ashley Sheridan wrote: > On Tue, 2009-02-17 at 15:13 -0500, Bastien Koert wrote: >> On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan >> wrote: >> >> > I've had a bit of a problem with a function I'm using for a form. >> > Essentially, the function looks like this:

Re: [PHP] function array problem

2009-02-17 Thread Andrew Ballard
On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan wrote: > I've had a bit of a problem with a function I'm using for a form. > Essentially, the function looks like this: > > function addEvent($values = Array('name' => '', 'venue' => '', > 'description' => '', 'errors' => Array())) > { >// code

Re: [PHP] function array problem

2009-02-17 Thread Ashley Sheridan
On Tue, 2009-02-17 at 15:13 -0500, Bastien Koert wrote: > On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan > wrote: > > > I've had a bit of a problem with a function I'm using for a form. > > Essentially, the function looks like this: > > > > function addEvent($values = Array('name' => '', 'venue'

Re: [PHP] function array problem

2009-02-17 Thread Bastien Koert
On Tue, Feb 17, 2009 at 3:10 PM, Ashley Sheridan wrote: > I've had a bit of a problem with a function I'm using for a form. > Essentially, the function looks like this: > > function addEvent($values = Array('name' => '', 'venue' => '', > 'description' => '', 'errors' => Array())) > { >// code

[PHP] function array problem

2009-02-17 Thread Ashley Sheridan
I've had a bit of a problem with a function I'm using for a form. Essentially, the function looks like this: function addEvent($values = Array('name' => '', 'venue' => '', 'description' => '', 'errors' => Array())) { // code here displays the form } The function is used to both display an emp

[PHP] Function, array - problem (probably easy to solve)

2001-03-14 Thread Tobias Talltorp
I am constructing a function for retrieving records from a mysql database and putting them into an array called $print_field[name][number]. My problem is that I only seem to get the first two records and I think I know where the problem is, but I canĀ“t seem to be able to solve it. Any ideas anyo