Re: [PHP] Display just 1 record in a query

2010-01-12 Thread Robert Cummings
Jochem Maas wrote: Op 1/13/10 12:43 AM, Robert Cummings schreef: deal...@gmail.com wrote: On Jan 12, 2010, at 1:57 PM, Ashley Sheridan wrote: Depends on how you're creating running the query. You could do something like: echo mysql_result($result, 1, 'fieldname'); Where $result is your res

Re: [PHP] Display just 1 record in a query

2010-01-12 Thread Jochem Maas
Op 1/13/10 12:43 AM, Robert Cummings schreef: > > deal...@gmail.com wrote: >> On Jan 12, 2010, at 1:57 PM, Ashley Sheridan wrote: >> >>> Depends on how you're creating running the query. You could do >>> something like: >>> >>> echo mysql_result($result, 1, 'fieldname'); >>> >>> Where $result is

Re: [PHP] Display just 1 record in a query

2010-01-12 Thread Robert Cummings
deal...@gmail.com wrote: On Jan 12, 2010, at 1:57 PM, Ashley Sheridan wrote: Depends on how you're creating running the query. You could do something like: echo mysql_result($result, 1, 'fieldname'); Where $result is your result object and 1 is a 0 indexed array, so would be the second r

Re: [PHP] Display just 1 record in a query

2010-01-12 Thread deal...@gmail.com
On Jan 12, 2010, at 1:57 PM, Ashley Sheridan wrote: Depends on how you're creating running the query. You could do something like: echo mysql_result($result, 1, 'fieldname'); Where $result is your result object and 1 is a 0 indexed array, so would be the second result. Thanks Ryan, Ashl

Re: [PHP] Display just 1 record in a query

2010-01-12 Thread Kim Madsen
Daevid Vincent wrote on 13/01/2010 00:00: Holy, Jesus, Marry and Joseph! You can't be serious with that?! So you're going to loop over potentially hundreds or thousands of records and only display one? Wow. Speechless. Either you're talking to dealtek or you didn't read my post very well: "An

RE: [PHP] Display just 1 record in a query

2010-01-12 Thread Daevid Vincent
> -Original Message- > From: Kim Madsen [mailto:php@emax.dk] > Sent: Tuesday, January 12, 2010 2:17 PM > To: deal...@gmail.com > Cc: php-general@lists.php.net > Subject: Re: [PHP] Display just 1 record in a query > > deal...@gmail.com wrote on 12/01/2010 22:52: > > I did a query... th

Re: [PHP] Display just 1 record in a query

2010-01-12 Thread Kim Madsen
deal...@gmail.com wrote on 12/01/2010 22:52: I did a query... then I display records like:   Q: but how I i just display a particular record with out the do / while loop? Just use extract($row_cur); before the table starts. That would give you first row onl

Re: [PHP] Display just 1 record in a query

2010-01-12 Thread Ashley Sheridan
On Tue, 2010-01-12 at 13:52 -0800, deal...@gmail.com wrote: > I did a query... then I display records like: > > > > > >  > > > > > > Q: but how I i just display a particular record with out the do / > while loop? > > like just the 2nd record only: > >

Re: [PHP] Display just 1 record in a query

2010-01-12 Thread Ryan Sun
though you can fetch twice to get the 2nd row $row_cur = mysql_fetch_assoc($cur); //skip 1st row $row_cur = mysql_fetch_assoc($cur); echo $row_cur['tid']; you should really modify your sql statement, like 'select xxx from xx order by xx limit 1, 1' (limit 1,1 retrieve your 2nd row if you are usin

[PHP] Display just 1 record in a query

2010-01-12 Thread deal...@gmail.com
I did a query... then I display records like:   Q: but how I i just display a particular record with out the do / while loop? like just the 2nd record only: i tried but this makes an error or $row_cur('tid',2) --- hmmm what's the syntax? Thanks, de

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread tedd
At 3:49 PM -0500 1/12/10, Robert Cummings wrote: tedd wrote: At 5:24 PM + 1/12/10, Ashley Sheridan wrote: On Tue, 2010-01-12 at 12:22 -0500, Robert Cummings wrote: -- egg snip-its While on the subject of eggs and other non-php topics, here's a life trick. If you don't know if an egg is

RE: [PHP] RE: Clean PHP 5.2.12 Build Core Dumping / Can't Build Port - FreeBSD 6.1

2010-01-12 Thread Don O'Neil
This is _exactly_ what I did, and as soon as I try a 'make all-depend-list' the error shows up. I don't even have the X11 system installed (it's a headless server, with no GUI). This is on a CLEAN 6.1 install, without any upgrades/patches, just straight off the ISO install and after a portsnap ins

Re: [PHP] 11 types of people in the world...

2010-01-12 Thread Robert Cummings
Daevid Vincent wrote: -Original Message- From: Michael A. Peters [mailto:mpet...@mac.com] Sent: Tuesday, January 12, 2010 2:46 AM To: Angus Mann Cc: php-general@lists.php.net Subject: Re: [PHP] corect way to use mail() function Angus Mann wrote: There are only 11 types of people in t

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread Robert Cummings
tedd wrote: At 5:24 PM + 1/12/10, Ashley Sheridan wrote: On Tue, 2010-01-12 at 12:22 -0500, Robert Cummings wrote: -- egg snip-its While on the subject of eggs and other non-php topics, here's a life trick. If you don't know if an egg is hard-boiled, or not, try spinning it. A hard-boil

RE: [PHP] 11 types of people in the world...

2010-01-12 Thread Daevid Vincent
> -Original Message- > From: Michael A. Peters [mailto:mpet...@mac.com] > Sent: Tuesday, January 12, 2010 2:46 AM > To: Angus Mann > Cc: php-general@lists.php.net > Subject: Re: [PHP] corect way to use mail() function > > Angus Mann wrote: > > There are only 11 types of people in this wor

Re: [PHP] RE: Clean PHP 5.2.12 Build Core Dumping / Can't Build Port - FreeBSD 6.1

2010-01-12 Thread hack988 hack988
1.add WITHOUT_X11=yes in /etc/make.conf 2.remove X11BASE="" from that file and 4.make all-depend-list 5.make clean all depend soft 6.make menuconfig set X11 disable 7.make &&make install 2010/1/12 Don O'Neil : > Ok.. just for grins I installed a new instance of 6.1, NO Patches, just > straight o

[PHP] any solution about array_walk with pass-by-reference UseData?

2010-01-12 Thread hack988 hack988
In Online Document say's: Users may not change the array itself from the callback function. e.g. Add/delete elements, unset elements, etc. If the array that array_walk() is applied to is changed, the behavior of this function is undefined, and unpredictable. So I'm use Use Optional param( [, mixed

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread Rolf Brejner
- Original Message - From: "Paul M Foster" To: "Ashley Sheridan" Cc: Sent: Tuesday, January 12, 2010 7:25 PM Subject: Re: [PHP] POLL: To add the final ?> or not... On Tue, Jan 12, 2010 at 06:08:59PM +, Ashley Sheridan wrote: On Tue, 2010-01-12 at 13:10 -0500, Paul M Foster w

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread Paul M Foster
On Tue, Jan 12, 2010 at 06:08:59PM +, Ashley Sheridan wrote: > On Tue, 2010-01-12 at 13:10 -0500, Paul M Foster wrote: > > On Tue, Jan 12, 2010 at 05:24:06PM +, Ashley Sheridan wrote: > > > > > > > There's always a chance that if thrown, the egg won't contact end-on. >

RE: [PHP] array_count_values Problem

2010-01-12 Thread Alice Wei
Hi, Thanks for the replies. Turns out that I can assign a variable $array_count = array_count_values($friend_from), and I accessed the individual values by doing for ($i=0;$i<$total_num;$i++) { $friend_location = $friend_from[$i]; $count_friend = $array_count[$friend_location

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread Ashley Sheridan
On Tue, 2010-01-12 at 13:10 -0500, Paul M Foster wrote: > On Tue, Jan 12, 2010 at 05:24:06PM +, Ashley Sheridan wrote: > > > On Tue, 2010-01-12 at 12:22 -0500, Robert Cummings wrote: > > > > > Michael A. Peters wrote: > > > > LinuxManMikeC wrote: > > > >> On Fri, Jan 8, 2010 at 1:24 PM, Daev

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread Paul M Foster
On Tue, Jan 12, 2010 at 05:24:06PM +, Ashley Sheridan wrote: > On Tue, 2010-01-12 at 12:22 -0500, Robert Cummings wrote: > > > Michael A. Peters wrote: > > > LinuxManMikeC wrote: > > >> On Fri, Jan 8, 2010 at 1:24 PM, Daevid Vincent > wrote: > > >>> I'm having a debate with a co-worker about

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread Ashley Sheridan
On Tue, 2010-01-12 at 12:52 -0500, tedd wrote: > At 5:24 PM + 1/12/10, Ashley Sheridan wrote: > >On Tue, 2010-01-12 at 12:22 -0500, Robert Cummings wrote: > > -- egg snip-its > > While on the subject of eggs and other non-php topics, here's a life trick. > > If you don't know if an egg is h

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread tedd
At 5:24 PM + 1/12/10, Ashley Sheridan wrote: On Tue, 2010-01-12 at 12:22 -0500, Robert Cummings wrote: -- egg snip-its While on the subject of eggs and other non-php topics, here's a life trick. If you don't know if an egg is hard-boiled, or not, try spinning it. A hard-boiled egg will s

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread Ashley Sheridan
On Tue, 2010-01-12 at 12:22 -0500, Robert Cummings wrote: > Michael A. Peters wrote: > > LinuxManMikeC wrote: > >> On Fri, Jan 8, 2010 at 1:24 PM, Daevid Vincent wrote: > >>> I'm having a debate with a co-worker about adding the final ?> on a PHP > >>> page... > >>> > >> So everybody, when do we

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread Robert Cummings
Michael A. Peters wrote: LinuxManMikeC wrote: On Fri, Jan 8, 2010 at 1:24 PM, Daevid Vincent wrote: I'm having a debate with a co-worker about adding the final ?> on a PHP page... So everybody, when do we get to the real discussion? Which end of an egg do we break? Depends upon how far a

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread Michael A. Peters
LinuxManMikeC wrote: On Fri, Jan 8, 2010 at 1:24 PM, Daevid Vincent wrote: I'm having a debate with a co-worker about adding the final ?> on a PHP page... So everybody, when do we get to the real discussion? Which end of an egg do we break? Depends upon how far away the Perl developer is

Re: [PHP] RewriteCond / rule for mod_rewrite

2010-01-12 Thread Ashley Sheridan
On Tue, 2010-01-12 at 08:49 -0500, John Corry wrote: > I have this in my .htaccess file (for a Magento installation). > > > ## never rewrite for existing files, directories and links > > RewriteCond %{REQUEST_FILENAME} !-f > RewriteCond %{REQU

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread LinuxManMikeC
On Fri, Jan 8, 2010 at 1:24 PM, Daevid Vincent wrote: > > I'm having a debate with a co-worker about adding the final ?> on a PHP > page... > So everybody, when do we get to the real discussion? Which end of an egg do we break? -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] array_count_values Problem

2010-01-12 Thread Jonathan Tapicer
Hi, The function array_count_values returns an array (http://php.net/array_count_values). So you are using it the wrong way, you should assign the return value to a variable and then access some index. Regards, Jonathan On Tue, Jan 12, 2010 at 11:09 AM, Alice Wei wrote: > > Hi, > >  I have a c

Re: [PHP] POLL: To add the final ?> or not...

2010-01-12 Thread John Corry
I leave ?> out. I'm pretty careful about my code formatting and whitespace. It's my opinion that if I can eliminate a potential problem by not including an optional closing tag...there's really no reason why I shouldn't. -- John Corry PHP developer - 3by400, Inc http://www.3by400.com

Re: [PHP] corect way to use mail() function

2010-01-12 Thread Michael A. Peters
Bob McConnell wrote: I believe the correct way to do this is to use the Sender: header for ord...@computility.com to show where it actually came from. Then it doesn't matter what you put in From. Bob McConnell I believe that is correct. -- PHP General Mailing List (http://www.php.net/) To

[PHP] array_count_values Problem

2010-01-12 Thread Alice Wei
Hi, I have a code in the following, after investigating more closely on how to use array_count_values(): //Calculate the number of elements in array $total_num = count($friend_from); $total_num2 = count(array_unique($friend_from)); for ($i=0;$i<=$total_num2;$i++) echo $friend_from[$i] . "

[PHP] RewriteCond / rule for mod_rewrite

2010-01-12 Thread John Corry
I have this in my .htaccess file (for a Magento installation). ## never rewrite for existing files, directories and links RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l #

RE: [PHP] I am not receiving any e-mail from the list...

2010-01-12 Thread Bob McConnell
From: paras...@gmail.com > On Mon, Jan 11, 2010 at 10:10, Richard wrote: >> >> I had this (I think) recently; mail simply stopped coming from the >> list and I can't remember unsubscribing (though that's not saying >> much...). I simply re-subscribed and all was dandy again. > > Quite possibl

RE: [PHP] corect way to use mail() function

2010-01-12 Thread Bob McConnell
From: LAMP > Hi, > The company I work for, hosts online events registration applications. > After a registered registered himself for an event he will get a > confirmation email saying he registered successfully. > Currently, in the header part of the mail(), in "From" it says e.g. > ord...@com

Re: [PHP] Using PHPDocumentor to document the magic functions.

2010-01-12 Thread Richard Quadling
2010/1/12 Jochem Maas : > Op 1/12/10 12:46 PM, Richard Quadling schreef: >> Hi. >> >> To implement public readonly properties you can use getX(), getY(), >> getZ() methods (which then access the private vars) or you can use >> __get($var) to consolidate/simplify the number of methods. >> >> With th

[PHP] Using PHPDocumentor to document the magic functions.

2010-01-12 Thread Richard Quadling
Hi. To implement public readonly properties you can use getX(), getY(), getZ() methods (which then access the private vars) or you can use __get($var) to consolidate/simplify the number of methods. With the discrete getters() it is easy to docblock them. Everything is obvious, but there is a LOT

Re: [PHP] corect way to use mail() function

2010-01-12 Thread John Black
LAMP wrote: Hi, The company I work for, hosts online events registration applications. After a registered registered himself for an event he will get a confirmation email saying he registered successfully. Currently, in the header part of the mail(), in "From" it says e.g. ord...@computility.co

Re: [PHP] corect way to use mail() function

2010-01-12 Thread Michael A. Peters
Angus Mann wrote: There are only 11 types of people in this world. Those that think binary jokes are funny, those that don't, and those that don't know binary. ErUmmm.shouldn't that read "...only 10 types of people..." ? 1 - those that think they are funny 10 - those that don't 11 -