Re: [PHP] Help with arrays

2004-03-11 Thread Jason Davidson
i supplied the wrong link, sorry.. this is the right one.. http://ca.php.net/manual/en/function.mysql-fetch-assoc.php Jason "Jason Davidson" <[EMAIL PROTECTED]> wrote: > > read about phps mysql_fetch_assoc in the manual.. this will explain what > your looking for. > http://ca.php.net/manual/en

Re: [PHP] Help with arrays

2004-03-11 Thread Jason Davidson
read about phps mysql_fetch_assoc in the manual.. this will explain what your looking for. http://ca.php.net/manual/en/function.mysql-fetch-array.php Jason "Elliot J. Balanza" <[EMAIL PROTECTED]> wrote: > > Yes ok but how do I store it? > > with array() how? > > vamp > > "Raditha Dissanay

Re: [PHP] Help with arrays

2004-03-11 Thread Raditha Dissanayake
Elliot J. Balanza wrote: Yes ok but how do I store it? with array() how? Whole business of reading from a db and storing into an array is probably redundant. You should try to directly process the contents of the db. This saves you memory and CPU. $variable['name'] = $value; is good.

Re: [PHP] Help with arrays

2004-03-11 Thread Elliot J. Balanza
Yes ok but how do I store it? with array() how? vamp "Raditha Dissanayake" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > Elliot J. Balanza wrote: > > > > >Then I need to store the values i receive in an array in the form of: > > > >$variable['name'] = value; > > > > > > $va

Re: [PHP] Help with arrays

2004-03-11 Thread Raditha Dissanayake
Elliot J. Balanza wrote: Then I need to store the values i receive in an array in the form of: $variable['name'] = value; $value. -- Raditha Dissanayake. --- http://www.radinks.com/upload/ Drag and Drop Upload thousands of files and

[PHP] Help with arrays

2004-03-11 Thread Elliot J. Balanza
I need to make a query to a MySQL database that only has two fields, name & value. That I can do. Then I need to store the values i receive in an array in the form of: $variable['name'] = value; But haven't been able to do it neither with a foreach nor with a do while... Can anyone please assist

Re: [PHP] help with arrays

2003-09-23 Thread Eugene Lee
On Tue, Sep 23, 2003 at 05:44:46PM -0400, Robert Cummings wrote: : On Tue, 2003-09-23 at 17:37, Eugene Lee wrote: : > On Tue, Sep 23, 2003 at 01:49:03PM -0700, Chris W. Parker wrote: : > : : > : Robert Cummings said: : > : > : > : > foreach( $data as $key => $value ) : >

Re: [PHP] help with arrays

2003-09-23 Thread Robert Cummings
On Tue, 2003-09-23 at 17:37, Eugene Lee wrote: > On Tue, Sep 23, 2003 at 01:49:03PM -0700, Chris W. Parker wrote: > : > : Robert Cummings said: > : > > : > foreach( $data as $key => $value ) > : > : I don't use that syntax much so I'm not familiar with it. Maybe I shoul

Re: [PHP] help with arrays

2003-09-23 Thread Eugene Lee
On Tue, Sep 23, 2003 at 01:49:03PM -0700, Chris W. Parker wrote: : : Robert Cummings said: : > : > foreach( $data as $key => $value ) : : I don't use that syntax much so I'm not familiar with it. Maybe I should : start eh? Another caveat: it works on a *copy* of the ar

Re: [PHP] help with arrays

2003-09-23 Thread Robert Cummings
On Tue, 2003-09-23 at 17:06, Pete James wrote: > Of course, you could do it in a much more cryptic way... just for fun. > AKA Perl style ;) -- .. | InterJinn Application Framework - http://www.interjinn.com | :-

Re: [PHP] help with arrays

2003-09-23 Thread Pete James
Of course, you could do it in a much more cryptic way... just for fun. :-) INPUT: $a = array( '0' => 'j', 'fname' => 'j', '1' => 'j', 'lname' => 'j', '2' => 'jj', 'state' => '', '3' => '[EMAIL PROTECTED]', 'ema

RE: [PHP] help with arrays

2003-09-23 Thread Chris W. Parker
Robert Cummings on Tuesday, September 23, 2003 1:43 PM said: > It doesn't get much simpler :) Doh!! > foreach( $data as $key => $value ) I don't use that syntax much so I'm not familiar with it. Maybe I should start eh? Thanks, Chris. -- PHP General Mailing Lis

Re: [PHP] help with arrays

2003-09-23 Thread Robert Cummings
It doesn't get much simpler :) foreach( $data as $key => $value ) { if( $value == '' ) { $data[$key] = ' ' } } Cheers, Rob. On Tue, 2003-09-23 at 16:38, Chris W. Parker wrote: > Hey people. > > I've got an array like this: > > > [0] => Array > ( > [

RE: [PHP] help with arrays

2003-09-23 Thread Chris W. Parker
Chris W. Parker <> on Tuesday, September 23, 2003 1:38 PM said: > Someone have a clue? Hmm... maybe www.php.net/array_keys will help me out here. chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] help with arrays

2003-09-23 Thread Chris W. Parker
Hey people. I've got an array like this: [0] => Array ( [0] => j [fname] => j [1] => j [lname] => j [2] => jj [state] => jj [3] => [EMAIL PROTECTED] [email] => [EMAIL PROTECTED]

Fwd: [PHP] Help with Arrays

2003-02-27 Thread Pushpinder Singh Garcha
Begin forwarded message: From: Pushpinder Singh Garcha <[EMAIL PROTECTED]> Date: Thu Feb 27, 2003 7:57:38 PM US/Eastern To: olinux <[EMAIL PROTECTED]> Subject: Re: [PHP] Help with Arrays Thanks My question was that each line of the file should be stored as one element of the ar

[PHP] help with arrays

2003-02-27 Thread Jim Long
Hi, Origninal Post: > I have an array with an html link as key and different $vars as val: > > $list = array ( > 'http://someplace.com/";>some place' => $vendor1_total, > 'http://anotherplace.com/";>another place' => $vendor2__total, > [snip] etc.. > > some vals are numeric and some vals are "

Re: [PHP] Help with Arrays

2003-02-27 Thread olinux
and what problem is that?> how about just using the example? http://www.php.net/manual/en/function.file.php $lines = file ('http://www.example.com/'); // Loop through our array, show html source as html source; and line numbers too. foreach ($lines as $line_num => $line) { echo "Line #{$line

[PHP] Help with Arrays

2003-02-27 Thread Pushpinder Singh Garcha
Hello all I am having some problem with arrays THIS IS THE PHP CODE $temp = file("file.txt"); if(!$temp) { echo "File could not be read by array !! "; exit; } else echo "Array was opened !!"; $x = count($temp); echo "Array Count is: $x"; echo "$temp[0]"; //$P = str

[PHP] help with arrays

2002-05-16 Thread Josh Edwards
This is a basic question but I'm a basic fellow. If I have an array $timespread = array("12am-01am"=>0); $timespread["01am-02am"]=0; $timespread["02am-03am"]=0; etc Using $time which is a number, I want to add 1 to the value of $timespread[$time] without changing the key so if $time =1 I want t