php-general Digest 15 Apr 2010 07:46:44 -0000 Issue 6693
Topics (messages 304098 through 304105):
Re: PHP & MYSQL sorting
304098 by: Ernie Kemp
Re: Basic switch statement
304099 by: Al
304100 by: Al
304101 by: Paul M Foster
304103 by: Ashley Sheridan
304104 by: Paul M Foster
Re: problems with feature '--with-pdo-oci' RPM (spec)
304102 by: Kevin Kinsey
changing NULL behavior in PHP arithmetic
304105 by: cr.vegelin.gmail.com
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Thanks for your thoughts. Ajax is the way to go...
Thanks,
.../Ernie
-----Original Message-----
From: tedd [mailto:tedd.sperl...@gmail.com]
Sent: April-12-10 10:18 AM
To: Ernie Kemp; 'PHP General List'
Subject: Re: [PHP] PHP & MYSQL sorting
At 8:16 PM -0400 4/11/10, Ernie Kemp wrote:
>Simple idea I thought.
>
>I need a webpage that displays a drop down list of number with a
>checkbox on the side that when checked will select the database
>again only in descending order.
>Small database with maybe 100 records.
>
>The user can click the submit button when they have located the
>correct number.
>
>The trick is to make the checkbox trigger a new Select statement.
>
>Thanks.
Ernie:
<form name="myForm" action="" >
<input type="checkbox" name="sort" id="sort" onClick="getData(this)" >
</form>
The javascript getData() will have to launch a php script to get the
data again OR you can simply sort the data yourself using sort().
Here's another idea using jQuery:
http://webbytedd.com/jquery/sortable-table/
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.801 / Virus Database: 271.1.1/2806 - Release Date: 04/12/10
02:32:00
--- End Message ---
--- Begin Message ---
On 4/14/2010 12:28 PM, tedd wrote:
At 5:06 PM -0400 4/13/10, Robert Cummings wrote:
Nathan Rixham wrote:
well that's one job I'm not getting :p
Well you DID get 66.7%. I've met "coders" that would stare at the
answer and still not understand :D
Cheers,
Rob.
Well.. count me among those staring. I just don't get those type of
things until I see them actually work.
My "logic" works the other way -- when presented with a logic problem, I
come up with a solution that works the way I think and I always to solve
the problem presented. Perhaps my solution isn't as clever nor as
cryptic as others, but it's always easier to read and understand.
Cheers,
tedd
I'm with you Tedd. I'm forever cussing myself when I use a super clever trick to
solve a logic problem and then later can't figure out how the damn thing worked
even though I documented it.
Incidentally, about formatting scripts, one of the reasons I like phpEdit is
that it has a terrific code beautifier. You can set it for phpDoc or Pear
rendering. And, it auto indents, etc. as you enter stuff.
Al...........
--- End Message ---
--- Begin Message ---
On 4/14/2010 12:28 PM, tedd wrote:
At 5:06 PM -0400 4/13/10, Robert Cummings wrote:
Nathan Rixham wrote:
well that's one job I'm not getting :p
Well you DID get 66.7%. I've met "coders" that would stare at the
answer and still not understand :D
Cheers,
Rob.
Well.. count me among those staring. I just don't get those type of
things until I see them actually work.
My "logic" works the other way -- when presented with a logic problem, I
come up with a solution that works the way I think and I always to solve
the problem presented. Perhaps my solution isn't as clever nor as
cryptic as others, but it's always easier to read and understand.
Cheers,
tedd
I'm with you Tedd. I'm forever cussing myself when I use a super clever trick to
solve a logic problem and then later can't figure out how the damn thing worked
even though I documented it.
Incidentally, about formatting scripts, one of the reasons I like phpEdit is
that it has a terrific code beautifier. You can set it for phpDoc or Pear
rendering. And, it auto indents, etc. as you enter stuff.
Al...........
--- End Message ---
--- Begin Message ---
On Wed, Apr 14, 2010 at 12:28:13PM -0400, tedd wrote:
> At 5:06 PM -0400 4/13/10, Robert Cummings wrote:
>> Nathan Rixham wrote:
>>>
>>> well that's one job I'm not getting :p
>>
>> Well you DID get 66.7%. I've met "coders" that would stare at the
>> answer and still not understand :D
>>
>> Cheers,
>> Rob.
>
> Well.. count me among those staring. I just don't get those type of
> things until I see them actually work.
>
> My "logic" works the other way -- when presented with a logic
> problem, I come up with a solution that works the way I think and I
> always to solve the problem presented. Perhaps my solution isn't as
> clever nor as cryptic as others, but it's always easier to read and
> understand.
+1
I've never had other coders looking over my shoulder, and I agonized for
years over whether my logical solutions were the "best" approach. Now I
just code and take pride in the fact that I can understand what I did
later (mostly).
Paul
--
Paul M. Foster
--- End Message ---
--- Begin Message ---
On Wed, 2010-04-14 at 16:52 -0400, Paul M Foster wrote:
> On Wed, Apr 14, 2010 at 12:28:13PM -0400, tedd wrote:
>
> > At 5:06 PM -0400 4/13/10, Robert Cummings wrote:
> >> Nathan Rixham wrote:
> >>>
> >>> well that's one job I'm not getting :p
> >>
> >> Well you DID get 66.7%. I've met "coders" that would stare at the
> >> answer and still not understand :D
> >>
> >> Cheers,
> >> Rob.
> >
> > Well.. count me among those staring. I just don't get those type of
> > things until I see them actually work.
> >
> > My "logic" works the other way -- when presented with a logic
> > problem, I come up with a solution that works the way I think and I
> > always to solve the problem presented. Perhaps my solution isn't as
> > clever nor as cryptic as others, but it's always easier to read and
> > understand.
>
> +1
>
> I've never had other coders looking over my shoulder, and I agonized for
> years over whether my logical solutions were the "best" approach. Now I
> just code and take pride in the fact that I can understand what I did
> later (mostly).
>
> Paul
>
> --
> Paul M. Foster
>
I think as long as the code is readable, and doesn't have any glaringly
obvious issues (I've seen people re-writing built in PHP functionality
because they didn't know the built-in function existed) then it should
be OK. Add comments to aid any areas where you think you might forget or
other people might not easily understand what is happening.
Don't get me wrong, clever ideas are nice, and sometimes with the right
comment they just work beautifully. Just occassionally though something
is done in such a neat clever way, that in the future when it comes time
to extend the system, this neat clever idea is actually a hindrance and
causes extra work because it has to be re-written a 'less-clever' but
more flexible way!
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
On Wed, Apr 14, 2010 at 10:06:39PM +0100, Ashley Sheridan wrote:
> On Wed, 2010-04-14 at 16:52 -0400, Paul M Foster wrote:
<snip>
>
>
> I've never had other coders looking over my shoulder, and I agonized for
> years over whether my logical solutions were the "best"
> approach. Now I
> just code and take pride in the fact that I can understand what I did
> later (mostly).
>
> Paul
>
> --
> Paul M. Foster
>
>
>
> I think as long as the code is readable, and doesn't have any glaringly
> obvious
> issues (I've seen people re-writing built in PHP functionality because they
> didn't know the built-in function existed) then it should be OK. Add comments
> to aid any areas where you think you might forget or other people might not
> easily understand what is happening.
>
> Don't get me wrong, clever ideas are nice, and sometimes with the right
> comment
> they just work beautifully. Just occassionally though something is done in
> such
> a neat clever way, that in the future when it comes time to extend the system,
> this neat clever idea is actually a hindrance and causes extra work because it
> has to be re-written a 'less-clever' but more flexible way!
That reminds me of a story. I once wrote what was almost an RPG (RPG--
the language, not the game) interpeter under FoxPro to handle incoming
EDI traffic and update invoicing, etc. The big problem with EDI is that
no one follows the standards properly, so every vendor tendering an
invoice did it differently. So you needed a database driven system which
would selectively make decisions based on each line of incoming EDI
content. Worked great, and when a new vendor came along, you just
analyzed their transactions and populated some more records in the
database to handle that vendor's transactions. I know, it sounds
obscure, but it made perfect sense at the time.
Shortly after that, I left that company. I documented the system, and it
worked fine, but it was hard to wrap your wits around how it worked. And
I just know the next coder on that account was cursing me day and night
for writing that system.
Anyway...
Paul
--
Paul M. Foster
--- End Message ---
--- Begin Message ---
Raul da Silva {Sp4wn} wrote:
# rpm -qpl /usr/src/linux/RPMS/x86_64/php52-pdo-oci-5.2.12-2.fc11.x86_64.rpm
/etc/php.d/pdo_oci.ini
/usr/lib64/php/modules/pdo_oci.so
# rpm --test -ivh
/usr/src/redhat/RPMS/x86_64/php52-pdo-oci-5.2.12-2.fc11.x86_64.rpm
error: Failed dependencies:
libclntsh.so.10.1()(64bit) is needed by
php52-pdo-oci-5.2.12-2.fc11.x86_64
I checked this steps, its ok :
1)
# ls -l /usr/lib/oracle/10.2.0.4/client64/lib/libclntsh.so
lrwxrwxrwx 1 root root 17 2010-04-12 19:38 /usr/lib/oracle/
10.2.0.4/client64/lib/libclntsh.so -> libclntsh.so.10.1
2)
# ldconfig -p | grep libclntsh.so
libclntsh.so.10.1 (libc6,x86-64) => /usr/lib/oracle/
10.2.0.4/client64/lib/libclntsh.so.10.1
libclntsh.so (libc6,x86-64) => /usr/lib/oracle/
10.2.0.4/client64/lib/libclntsh.so
What is wrong ? , thanks for help
http://bugs.php.net/29301
??
Kevin Kinsey
--- End Message ---
--- Begin Message ---
Hi All,
Is there an option in PHP to change the behavior of NULL in PHP functions ?
Now PHP uses NULL as a 0 (zero) for arithmetic, for example:
NULL + 6 = 6
NULL * 6 = 0
NULL / 6 = 0
6 / NULL = Division by zero
What I need is the same behavior as #N/A (or =NA()) in Excel, where:
#N/A + 6 = #N/A
#N/A * 6 = #N/A
#N/A / 6 = #N/A
6 / #N/A = #N/A
because arithmetic operations with "Unknown" operands should result to
"Unknown" ...
TIA, Cor
--- End Message ---