RE: [PHP] Friday's Question

2013-09-20 Thread Jeff Burcher
 -Original Message-
 From: Tedd Sperling [mailto:t...@sperling.com]
 Sent: Friday, September 20, 2013 12:52 PM
 To: php-general@lists.php.net
 Subject: [PHP] Friday's Question
 
 Hi gang:
 
 Do you use a Mousepad?
 
 My reason for asking is that I've used a Mousepad ever since mice first
came
 out (back when they had one ball).
 
 Now that mice are optical (no balls), Mousepads are not really needed --
or
 so I'll told by the college -- you see, they don't provide Mousepads for
their
 student's computers.
 
 As such, I wondered what's the percentage of programmers still using a
 Mousepad?
 
 Secondly, are Mousepads used primarily by older programmers (like me)
 while younger programmers don't use Mousepads, or what?
 
 So -- please respond with:
 
 Age: *
 Mousepad: Yes/No
 
 Thank you,
 
 tedd
 
 PS: * If you don't want to provide your actual age, then indicate your age
by
 stating young, middle-age, old-age, ancient, or whatever term
 describes your age.
 
 Alternate -- I claim that you can tell a man's age by ten-times the number
of
 personal products he routinely uses, for example:
 
 Years Old - Personal Products
 10Toothpaste
 20Toothpaste, Deodorant
 30Toothpaste, Deodorant, Aftershave
 40Toothpaste, Deodorant, Aftershave, Minoxidil
 50Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H
 60Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag
 Bomb
 70Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag
 Bomb, Fixodent
 
 So, you could indicate age by stating Bag Bomb like me.
 
 ___
 tedd sperling
 t...@sperling.com
 
 
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php
 

 Age: 54
 Mousepad: Yes

Laser mice don't like reflective surfaces so much and if I don't carve out
desk space for my mouse with a mousepad, I find that moving my mouse over
multiple sheets of paper, paperclips, and whatnot is not very effective and
somewhat frustrating.

Jeff




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] how old is this version of PHP?

2013-08-19 Thread Jeff Burcher

I apologize if this is off topic, but this raises a question for me. Why
can't new versions be backwards compatible? Is it really that difficult to
accomplish? This has been a complaint of mine for years with Windows ever
since we went from 95 to 98. I am an AS400 programmer and I have legacy
programs written in RPG II, which died 20 years ago, and they still run fine
on the newest version of AS400 or iSeries or Power System or whatever the
heck it is called now. I also have PHP scripts that are many years old that
work just fine the way they are, if a new version doesn't come along and
make me have to reprogram for no reason just because it can't handle older
code. Really, have Do loops and data calls changed that much over the years?
I mean, all you do is set a condition, use a variable key field, and voila,
data is pulled and processed, no big deal. Yeah, you can get fancy with it,
but the core basics are still the same. I have been programming for over 35
years and like to think that once a program is built it should run forever.
Do we just accept that we have to rewrite every program we ever wrote every
time a new version comes out? A little extreme, but you get my point.
Comments? Suggestions?

(I am also the kind of guy who thinks quality made hand tools from the 1800s
are superior to many purchased today at Lowes or Home Depot.)

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping Works
Making Metal Parts since 1946.


 -Original Message-
 From: Lester Caine [mailto:les...@lsces.co.uk]
 Sent: Monday, August 19, 2013 6:24 AM
 To: php-general@lists.php.net
 Subject: Re: [PHP] how old is this version of PHP?
 
 Larry Garfield wrote:
  5.2.9 was released in February of 2009.  5.2 is completely retired and
  out of support.  5.3 is on security-only life-support.  5.4 is the
legacy stable
 release.
 
  Yes, 5.2.9 IS that old. :-)  Really, get a host that has made it into
  this decade.  (GoDaddy apparently doesn't meet that qualification.)
  You're doing clients a disservice by allowing them to run such an
  ancient and unsupported version.
 
 While the statements are correct, many users are not in a position to move
 from their currently working systems to even 5.3 let alone 5.4. There is
still a
 lot of legacy code that unless a few more people step up and help bring it
 forward for the many - non programming - users who are stuck with legacy
 applications, they will remain requiring 5.2 to run. ISPs got caught out
when
 they arbitrarily moved accounts forward, and GoDaddy have even been
 caught by that, so maintaining a LTS version of PHP5.2 is the lesser evil
...
 Windows 2000 is supposed to be dead, but *I* still have sites reliant on
it
 because the code and hardware is unsupported in even XP. Saying
 something is dead only works if there is an affordable way of moving
forward
 ;)
 
 --
 Lester Caine - G8HFL
 -
 Contact - http://lsces.co.uk/wiki/?page=contact
 L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve -
 http://enquirysolve.com/ Model Engineers Digital Workshop -
 http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
 
 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] select function

2012-10-25 Thread Jeff Burcher
Hi,

 

I can't remember if this is the PHP list for RPG programmers or not, so
apologize if this is the wrong one.

 

Is there an equivalent command in PHP for the SELECT statement in RPG? I see
switch, which is a little similar, but far from how it actually functions.

 

For those not familiar with the SELECT statement here is how I envision it
working in a PHP format similar to switch:

 

SELECT {

WHEN $Auth = 0:

WHEN $A = 1:

echo('$Aprint_list');

WHEN $B = 1:

echo('$Bprint_list');

WHEN $A = 2:

echo('$Aprint_list');

echo('$Aprint_list');

WHEN $B = 2:

echo('$Bprint_list');

echo('$Bprint_list');

DEFAULT:

}

 

The syntax may be a little off, but you get the picture. No breaks are
needed because it only performs the first match it comes to, then exits the
SELECT statement when finished the commands under that match. Putting a WHEN
statement with nothing to perform means exactly that, if this matches, do
nothing, then exit the SELECT statement. I hope that makes sense. The big
difference is you can put anything behind each WHEN statement as opposed to
looking at only the one variable like with switch. I am thinking I just need
to get creative with the switch or elseif commands, but thought I would ask
the list first if they had any better suggestions.

 

 

Thanks,

 

Jeff Burcher - IT Dept

Allred Metal Stamping

PO Box 2566

High Point, NC 27261

(336)886-5221 x229

j...@allredmetal.com

 



RE: [PHP] Bounce messages

2012-09-21 Thread Jeff Burcher
Hi,

I don't know if this is specifically what he is referring to when he says, the 
'reply to sender' email handling camp , but I know that when I just click 
Reply it goes to the individual whose post I am commenting on. I need to click 
on Reply All and several emails are in the blanks and I need to delete them all 
and move the list email address from the CC: box to the TO: box. If I am not 
paying attention and don't do this little email musical chairs process, 
sometimes I will get out of office replies from some of the email addresses in 
the reply. Is this 'bouncing'?

Jeff

 -Original Message-
 From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
 Sent: Friday, September 21, 2012 2:56 PM
 To: Jim Lucas
 Cc: Lester Caine; php-general@lists.php.net
 Subject: Re: [PHP] Bounce messages
 
 On Fri, 2012-09-21 at 09:56 -0700, Jim Lucas wrote:
 
  On 09/21/2012 12:40 AM, Lester Caine wrote:
   I know that the php list are one of the 'reply to sender' email
   handling camp rather than reply to list. I can cope with that now
   and handle the multiple reply address problem this end so I ONLY
   reply to list. BUT is there no way of cleaning up the bounce emails
   we all get when posting to the list(s)?
  
   ( Waits to delete all the bounce messages for this post :) )
  
 
  Doing a little checking on your IP address, I have found that your
  mail server IP is listed on a black list.  Check the link below.
 
  http://mxtoolbox.com/SuperTool.aspx?action=blacklist%3a213.123.20.127
 
  This could be the source of your bounce messages.
 
  --
  Jim Lucas
 
  http://www.cmsws.com/
  http://www.cmsws.com/examples/
 
 
 
 I sporadically get a lot of messages that appear as bounces where people on
 the list filter out replies and make you sign up to some web service to prove
 you're a real person. Is that the sort of bounce you're talking about?
 
 --
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk
 





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Programmers and developers needed

2012-09-18 Thread Jeff Burcher
 -Original Message-
 From: Robert Cummings [mailto:rob...@interjinn.com]
 Sent: Tuesday, September 18, 2012 2:22 PM
 To: Matijn Woudt
 Cc: Daevid Vincent; PHP-General
 Subject: Re: [PHP] Re: Programmers and developers needed
 
 On 12-09-18 02:12 PM, Matijn Woudt wrote:
  On Tue, Sep 18, 2012 at 8:02 PM, Daevid Vincent dae...@daevid.com
 wrote:
  -Original Message-
  From: Matijn Woudt [mailto:tijn...@gmail.com]
 
  You're missing the most important aspect of social networks..
 Advertising.
 
  Please tell me that is said sarcastically. Advertising is the cancer of the
 internet. There was a time when there weren't ad banners, interstitials, pop-
 ups, pop-unders, spam, and all the other bullshit you have to sift through on
 a daily basis.
 
 
  No,  I was not meant to be sarcastic. You might find advertising to be
  the cancer of the internet, think again. The internet would be pretty
  much dead without ads, or would you rather pay $0.01 per Google search
  query? $0.01 for each e-mail send, $0.01 for each news article you
  want to read, etc, etc? (or more related, $0.01 for each facebook
  message you want to send/read?)
 
  In the end, good advertising means success, take the drop of facebook
  shares because of the investors being worried about facebooks'
  advertising possibilities.
 
 History suggests the internet would be here without advertising since it
 originated without advertising, originally grew without advertising, and 
 finally
 evolved into this mixed blessing we have today. There's plenty of greatness
 on the internet, there's also plenty of steaming piles of manure.
 
 Cheers,
 Rob.

Yeah, it grew out of government funding before advertising via educational 
institutions and the military. Would you rather have a free economy supported 
internet or a government controlled internet? Also, for those of us who are old 
enough to remember posting to text based bulletin boards, the influx of 
corporate money has greatly increased the infrastructure and functionality of 
the internet and has helped to make it a global phenomenon, which a government 
supported internet may have never become. Money makes all things possible. If 
you don't think so, try building a server farm and hooking up to a trunk line 
without it. My two cents. Now, I'm broke.

Jeff
 --
 E-Mail Disclaimer: Information contained in this message and any attached
 documents is considered confidential and legally protected.
 This message is intended solely for the addressee(s). Disclosure, copying,
 and distribution are prohibited unless authorized.
 
 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php
 





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] MS SQL server connection problem.

2012-09-05 Thread Jeff Burcher
Hi,

I am relatively new as well. I tried both of those methods with no luck. I
finally had success using odbc_connect(). See below:

$conn = odbc_connect(Driver={SQL
Server};Server=$server;Database=$database;, $user, $password);

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com

 -Original Message-
 From: Girish Talluru [mailto:girish.dev1...@gmail.com]
 Sent: Wednesday, September 05, 2012 5:57 AM
 To: php-general@lists.php.net
 Cc: rahu...@radiare.co.in
 Subject: [PHP] MS SQL server connection problem.
 
 Hi All,
 
 I'm having problem while connecting to MS SQL server from my php
 program.
 
 I tried downloading driver from Microsoft and changed php.ini file but it
is
 showing the following error.
 
 This statement I used to connect.
 $connect = mssql_connect(localhost, PC6, password);
 
 This is the error message I got
 Call to undefined function mssql_connect() in
 C:\wamp\www\Test\dbTest.php
 
 Then I tried other one as shown below:
 
 
 This statement I used to connect.
 $connect = sqlsrv_connect(localhost, PC6, password);
 
 This is the error message I got
 Array ( [0] = Array ( [0] = IMSSP [SQLSTATE] = IMSSP [1] = -49 [code]
= -
 49 [2] = This extension requires the Microsoft SQL Server 2012 Native
Client.
 Access the following URL to download the Microsoft SQL Server 2012 Native
 Client ODBC driver for x86:
 http://go.microsoft.com/fwlink/?LinkId=163712 [message] = This extension
 requires the Microsoft SQL Server 2012 Native Client. Access the following
 URL to download the Microsoft SQL Server 2012 Native Client ODBC driver
for
 x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] = Array ( [0] =
 IM002 [SQLSTATE] = IM002 [1] = 0 [code] = 0 [2] = [Microsoft][ODBC
 Driver Manager] Data source name not found and no default driver specified
 [message] = [Microsoft][ODBC Driver Manager] Data source name not
 found and no default driver specified ) )
 
 It is asking to download a native client. but i have already downloaded a
 driver at http://www.microsoft.com/en-in/download/details.aspx?id=20098
 named SQLSRV30.EXE
 
 why do I need a native client or ODBC driver when I already got this
driver
 installed in my system.
 
 Please help me out with this guys. I'm new to this.
 
 Thanks,
 Girish Talluru




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-20 Thread Jeff Burcher
 -Original Message-
 From: Lester Caine [mailto:les...@lsces.co.uk]
 Sent: Friday, July 20, 2012 4:05 AM
 To: php-general@lists.php.net
 Subject: Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal
 
 Paul M Foster wrote:
  Here's another one: There are currently discussions in the U.S.
  Congress in favor of forcing internet vendors to charge sales tax
  on*all*  sales, regardless of whether the vendor has a presence in that
 state or not.
  Imagine having to file state sales tax returns in 50 states. This
  effort has rather significant bipartisan support. Now ask yourself
  what large corporation with brick and mortar stores *wouldn't* sign on
  to support this one? That's what you're up against. You've got
  Amazon.com on your side. Yay. You might want to get busy on that one.
 
 In Europe VAT is applied even on on-line sales. It is the likes of Amazon
 shipping bulk stock from overseas 'clients' into European warehouses and
 then supplying them without VAT added directly in Europe that is the
 problem! How can I compete with someone who is also giving next day
 delivery, but 20% cheaper ...
 American sellers are one of the problems here.
 
 There are two sides to every problem and simply fighting for one side is
as
 bad.
 What is needed is a reasoned debate rather than things like 'The Cat
Signal'
 which personally I find as objectionable as the laws it's complaining
about!
 
 --
 Lester Caine - G8HFL
 -
 Contact - http://lsces.co.uk/wiki/?page=contact
 L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve -
 http://enquirysolve.com/ Model Engineers Digital Workshop -
 http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

This sounds more like a business annoyance than an internet freedom problem,
but okay. Technically, in the US, I thought it is the end-consumer that
needs to pay a sales tax to the state where they live. Consumer retail
businesses are required to tack them on at the point of sale as a
convenience for both the consumer and the government, then pass the money
on. The seller only pays taxes, to the municipality(s) where their business
is physically located, based on their net profit. So the sales tax itself
does not come out of the company's pocket. The company bears the cost of
tracking, processing, and forwarding the taxes to the government(s)
involved, but that is a deductible expense. Sales taxes are a tedious, but
not costly, normal business expense.

Really, how hard is it for computer savvy people to sort their sales
transactions by customer's state and sum up the sales tax amounts paid so
they can write a check every quarter. Many businesses would be happy to have
to mail 50 checks every quarter, one to each state. That means they are
making sales in every state!  That sounds like a profitable business to me.
And as far as filling out 50 sales and use tax forms each quarter, they have
these things called computers now that make pulling in data and printing
forms happen at the touch of a button. Maybe some enterprising programmer
could write software to do just that and sell it on the internet.

We need to stop playing idealistic revolutionary and help shape real
solutions. The fact that you are allowed to run a business on the internet
is the internet freedom you are looking for. You have won the revolution!
Now, deal with the realities of running a business. Putting your business on
the internet should not be a magic pass to avoid the costs of doing
business. We need to admit we are part of the system and figure out a
streamlined way for internet businesses to pay their fair share. The Free
in free economy does not mean it doesn't cost money, time, effort, etc. to
do business.

The internet is not a magic cloud run by fairy dust. The internet was
created by military and higher educational systems, both tax supported
entities. Corporations and governments maintain the infrastructure that
keeps the internet working. Without governments and corporations there would
be no internet. They are the internet. The alternative is to go back to ham
radios. Sorry for the rant, this is a hot button topic for me.


Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] What do you call the end-user?

2012-07-19 Thread Jeff Burcher
Hi,

I have always held that the opinion of the end-user/customer is the most
important goal in any systems development project, small or large,
regardless of the programming language/environment. The database structure,
programming, and interfaces are your product. If folks don't like it or
can't figure out how to use it or can't wait until something better comes
along, your product won't survive long in the marketplace. This attitude
should also be held for developers creating in-house solutions as well.
While management may have an overall goal for the purpose of the
programming, the people who will eventually be the ones typing/clicking
their way through your programs are the ones to ultimately satisfy. This
means more pro-active design work with the front line users is always
advisable to create long lasting programs/systems. I use mostly PHP to
create web-based interface screens for AS400 programs in a manufacturing
environment. I can spend all the time I want programming the next greatest
program, but if the guys in the plant don't/won't use it, I have completely
wasted my time. My two cents.


Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com

 -Original Message-
 From: Tedd Sperling [mailto:t...@sperling.com]
 Sent: Thursday, July 19, 2012 1:27 PM
 To: php-general@lists.php.net General
 Subject: [PHP] What do you call the end-user?
 
 Hi gang:
 
 I can't wait for tomorrow -- so here's my off-topic post today.
 
 First question:
 
 What do you call the people who ultimately use your code?
 
 I call them the end-user, but others have stated other terms, such as
 customer or user.
 
 Second question:
 
 Are you concerned with their (whomever) experience in using your code?
 
 This question transcends your code working correctly, accurately, and
 securely -- no need to comment on those aspects. But rather more
 specifically do you consider how easily your whomever can use your work
 efforts?
 
 As you may have guessed - I just attended a UX conference and they provide
 an interesting perspective on UX. I was wondering how php developers
 typically address the subject.
 
 Cheers,
 
 tedd
 
 
 t...@sperling.com
 http://sperling.com
 
 
 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Jeff Burcher
Hi,

I have been out of the loop and just did some quick skimming of SOPA/PIPA to
see what all the fuss was about. PIPA seems a little vague, but SOPA seems
pretty straight forward, stop piracy of copyrighted materials. I don't
understand what is wrong with that?

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com


 -Original Message-
 From: Kris Craig [mailto:kris.cr...@gmail.com]
 Sent: Thursday, July 19, 2012 3:40 PM
 To: Ferenc Kovacs
 Cc: Daniel Brown; php-webmas...@lists.php.net; php-general@lists.php.net
 Subject: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal
 
 On Thu, Jul 19, 2012 at 12:36 PM, Ferenc Kovacs tyr...@gmail.com wrote:
 
 
  2012.07.19. 20:21, Daniel Brown danbr...@php.net ezt írta:
 
  
   Forwarding to php-webmas...@lists.php.net, as it's not a
   general user issue where it pertains to php.net.
  
   On Thu, Jul 19, 2012 at 2:02 PM, Kris Craig kris.cr...@gmail.com
  wrote:
Hey guys,
   
I just became aware of this:
   
http://internetdefenseleague.org/
   
   
It's a site setup by Mozilla, Reddit, and others to defend
internet
  freedom
in the wake of recent legislative events in the U.S. and elsewhere
  (full
members list here:
 http://www.internetdefenseleague.org/members).
   
They've setup what they're calling the cat signal, an invisible
bit
  of
embeddable code you can put in your website that will activate
(and
  display
the afore-mentioned signal/link/etc) if/when the next
SOPA/PIPA/etc
  comes
along that threatens the open internet.
   
I'd like to propose that we integrate this into the PHP website.
This issue directly affects our community and we already staked a
claim in
  this
fight when we participated in the last great blackout.
   
In addition, I'd also l ike to propose that we officially join
this
  group
as a member.  I'm not sure if we'd do this by vote or something
  similar to
the RFC process  etc, but if you'll grant me permission, I'd be
happy
  to
do the legwork on this myself (make the HTML edits, contact the
organization on PHP's behalf, etc).
   
   
Thoughts?
   
--Kris
  
  
  
   --
   /Daniel P. Brown
   Network Infrastructure Manager
   http://www.php.net/
  
   --
   PHP Webmaster List Mailing List (http://www.php.net/) To
   unsubscribe, visit: http://www.php.net/unsub.php
  
 
   Btw. we were asked by the to join the league as we were a big traffic
  source on the black out day.
  I don't know if Rasmus is on the webmaster list or not, but we should
  cc him, as he was the driving force behind us joining the anti SOPA
 movement.
 
 I heard back from the webmaster saying that we're already participating
with
 the cat signal on our website.  Given this and no objections, I went ahead
and
 contacted them and asked that they list us on their participating members
 page.
 
 --Kris



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Jeff Burcher
Hi,

I agree. My wife is from China and both copyright issues and government
enforcement of things have a whole new meaning there, so I understand the
concerns on both sides.

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com


 -Original Message-
 From: Lester Caine [mailto:les...@lsces.co.uk]
 Sent: Thursday, July 19, 2012 4:10 PM
 To: php-general@lists.php.net
 Subject: Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal
 
 Jeff Burcher wrote:
  I have been out of the loop and just did some quick skimming of
  SOPA/PIPA to see what all the fuss was about. PIPA seems a little
  vague, but SOPA seems pretty straight forward, stop piracy of
  copyrighted materials. I don't understand what is wrong with that?
 
 It depends on how heavy handed the solution is ... Currently I can't get
 torrent downloads of Linux distribution DVD's because torrent is blocked.
 Just because some people abuse a technology is no reason to kill that
 technology for legitimate uses?
 
 Action groups that just target one country are a little irritating to the
rest of
 us ... a world wide solution is needed.
 
 --
 Lester Caine - G8HFL
 -
 Contact - http://lsces.co.uk/wiki/?page=contact
 L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve -
 http://enquirysolve.com/ Model Engineers Digital Workshop -
 http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] global array

2012-06-14 Thread Jeff Burcher
Hi,

 

I am running PHP 5.4 on IIs 6 on a Windows SBS 2003 server. Here is a
streamlined version of the code I am dealing with. I tried to trim as much
as possible to only show code that deals with my issue. The main issue I
think I am having is the global array statement within the function is not
working. From all of the articles I have read, I seem to be doing it
correctly, yet it does not recognize $InvReq as an array within the
function. The array works just fine outside of the function, though. Here
are the error messages:

 

Notice: Undefined variable: InvReq (line numbers point to inside the
function)

Warning: array_key_exists() expects parameter 2 to be array, null given
(line numbers point to inside the function)

 

If anyone could point out where I have incorrect syntax or something else
that would interfere with the global reference for the array within the
function, or tell me I can't do what I am doing using arrays, but assume I
don't have the ability to write to an external work table, which is why I am
trying to use an array in the first place. Thanks.


-

?php

$InvReq = array();

 

// there is some database action here and other programming, but the core
issue is writing to the array, so assume I have all of the necessary data

// data loop to gather inventory requests ---

$linetotal = ???;

$hldpartID = ?; //these variables are provided
by looping, so this check/write/update code snippet happens many times to
update/write to the array

 

if (array_key_exists($hldpartID, $InvReq)) {

$InvReq[$hldpartID] += $linetotal;
//if this line will create the array entry if it does not exist, then I
don't need the key_exists check, anyone??

} else {

$InvReq[$hldpartID] = $linetotal;

}

 

Part_BOM($hldpartID, $linetotal, 1);   //function is
called the first time to set up the BOM

// end loop ---

 

// after gathering all of the inventory requests, check for inventory on
hand

reset ($InvReq);

while (list($PartID,) = each($InvReq)) {

// data loop to get inventory on hand ---

$OnHandQty = ???; //these variables
are provided by looping, so this check/write/update code snippet happens
many times to update/add to the array

 

if (array_key_exists($PartID, $InvReq)) {

$InvReq[$PartID] -=
$OnHandQty;

} else {

$InvReq[$PartID] =
$OnHandQty;

}

Part_BOM($PartID, $OnHandQty, 2);
//function is called the second time to trim up BOM

// end loop ---

}

// print list

$display_block = h2Part Forecast/h2tabletrthPart
Number/ththAmount Needed/th/tr;

reset ($InvReq);

while (list($PartID,$need) = each($InvReq)) {

$needout = number_format($need);

$display_block .=
trtd$PartID/tdtd$needout/td/tr;

}

$display_block .= /table;

 

//---this function adds or subtracts inventory to/from the BOM materials for
the part passed.

//---it also can add parts that make parts with their inventory total for a
multiple level BOM

 

function Part_BOM($PartID, $need, $phase) {

 

global $Invreq;

 

$BOMreq = $need * $BOMQty; //$BOMQty 
$BOMPartID are pulled from a database keyed by $PartID

 

if ($phase == 1) {

if (array_key_exists($BOMPartID, $InvReq)) {

$InvReq[$BOMPartID] +=
$BOMreq;  //first time through adds to array item totals

} else {

$InvReq[$BOMPartID] =
$BOMreq;

}

} else {

if (array_key_exists($BOMPartID, $InvReq)) {

$InvReq[$BOMPartID] -=
$BOMreq;   //second time through subtracts from array item totals

}

}

 

if (--check for parts within other parts for multiple level
BOM--) {

Part_BOM($BOMPartID, $BOMreq, $phase);
//this calls itself and can refer/loop back to itself several times

}

}

?

html

head

/head

body

center

?php echo $display_block ?

/center

/body

/html


--

Thanks for your input,

 

Jeff Burcher - IT Dept

Allred Metal Stamping

PO Box 2566

High Point, NC 27261

(336)886-5221 x229

RE: [PHP] global array

2012-06-14 Thread Jeff Burcher
You're a genius!! Thank you. Uppercase 'R', sheesh. PHP is sooo picky. I worked 
for two days trying to figure that one out. Anyway, for future reference, you 
can pass the entire array as a variable like that?? and do you know if the '+=' 
statement will create an array entry if one doesn't exist?

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com


 -Original Message-
 From: ma...@behnke.biz [mailto:ma...@behnke.biz]
 Sent: Thursday, June 14, 2012 8:04 AM
 To: php-general@lists.php.net; j...@allredmetal.com
 Subject: Re: [PHP] global array
 
 
 
 
 Jeff Burcher j...@allredmetal.com hat am 14. Juni 2012 um 13:55
 geschrieben:
 
 
  function Part_BOM($PartID, $need, $phase) {
 
 
 
  global $Invreq;
 
 
 uppercase R !!!
 And much better is adding it as another parameter and inject it:
 
 function Part_BOM($PartID, $need, $phase, $InvReq) { 
 }
 
 // call it
 Part_BOM(..., ..., ..., $InvReq);
 
 And please read about foreach() and what you can do with it.
 
 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php