I think you got the easier LAMP project than me :-( As of today (technically, though not in reality for three weeks) my job changed from 100% network technician to being 50% net tech and 50% intranet developer. I've been frantically learning PHP to ensure I have a fighting chance at the work. I'm supposed to be shoe-horning Mambo Open Source (http://www.mamboserver.com) and Moodle (http://moodle.org/) together to make 'an integrated environment that will promote student learning'.. or at least I think that was the phrase I got chucked at me. On 1 Sep 2004 at 13:11, adrian.wells wrote: That's very kind of you Matt - A copy is on it's way. This is my first "major" LAMP project and I'm still at the development stage yet so lots to do, so I'm happy with KISS if 'cleaver and elegant' is taking too long, I can always come back to the code later. I have also noted that some users talk about implicitly closing the connection - I've never done this in the past - while others make no mention - maybe this is where the fault lays, strange though that it does the correct deletes! I do make lots of repetitive opening of tables where I ought to be using inner-join, but I'm trying to keep the pages fairly simple for future changes and to allow my tech to get his head around it - He's already messed up my naming convention having left me to it over the holiday! :-) It's amazing how this slows down development when a field or even a table has a different name to that expected. We start back next Wednesday, so after we've been using it for a while and decided what alterations are required, we'll publish a description in case anyone would like a copy to play with. I'm sure that there are systems already written, but we wanted to do it ourselves. Later Adrian
Hmm I've never used seperate database connections within individual functions, I've never seen this done either.
The only thing you have to be careful of is calling functions that run queries from inside another function.
On the subject of books, when I started to learn PHP about 4 years ago I bought the Wrox book Professional PHP Programming
http://www.amazon.co.uk/exec/obidos/ASIN/1861002963/qid=1094029692/sr=1-5/re...
It's probably a bit old now but see there is a new one out for PHP5. I
always take a look at the wrox books, most of them are very good.
Adrian I keep meaning to have a look at your original code for you but I'm
mail it me again as a text file attachment I'll have a look at it for you.
Matt
On Wed, 01 Sep 2004 08:58 , 'Paul Graydon'
sent: *sounds of strained braincells heard across campus* PHP isn't really my language (not yet at least.. just starting to learn it now I'm taking on the Intranet development here), but I seem to recall when I went through some on-line PHP tutorials the writer advising that you should open and close the database independantly inside a function.. I thought that was a bit OTT and timewasting amongst other things. Might have some value? I'm learning from the "PHP and MySQL Web Development" book at the moment (http://www.amazon.co.uk/exec/obidos/ASIN/067232525X/qid=109402 5644/ref=sr_8_xs_ap_i1_xgl/026-8725205-8171660), and that certainly doesn't seem to follow that advice. *shrug*
On 31 Aug 2004 at 18:24, Adrian Wells wrote:
Hi Paul,
Thanks for your note, purely for interest... I found that using a call to my function worked perfectly if I used it once. If I called it more than once (on the same page), with data for different tables, it would correctly delete all existing references as required (these are just linking
on webmail at the moment and it shows some stuff in html. If you tables)
but added all subsequent data to the first table referenced even though I could print the correct table name for each call! Using any of the calls to my function singly (slashing out the others) worked fine. I'd wasted so much time with the square braces fiasco that I decided to do the updates in-line and they worked fine first time!
Maybe it's a machine issue, although I've seen no other problems and it serves the pages plenty quick enough for our needs. Our LAMP is using everything as standard (may have on-line updates) from the SuSE 9.0 disks on a Dell P2 266 optiplex with 96MB (?) and a 2GB HDD
Since PHP 5.0.1 has been released, I'll not bother to report it as a bug - but it did help loosen a little more hair :-)
Kind regards Adrian
I thought PHP was supposed to be thread-safe? The only circumstances under which there is believed to be issues is Apache2, but most people I've spoken to who use Apache 2 in their LAMP servers haven't reported any issues at all.
On 26 Aug 2004 at 16:05, adrian.wells wrote:
Hi Adrian
When using multiple select boxes you have to append the name of the select element with [] so PHP know to expect/convert it to an array.
so you example would need to be
$_POST['dcdrom'] will now be an array
Thanks Matt :-)
Having looked over some examples again, I see that now but missed it before! (But you'd be amazed how many typo's there are out there. I don't understand why people don't copy and paste).
It now returns "array" :-)
Many Many thanks :-)
As an aside, I was unable to edit the data via a subroutine, although I was able to show that the correct data was being passed/processed, it just trashed the data, wierd! but if I did the updates in-line no problem! Maybe it has something to do with threads within PHP Version 4.3.3 ? Anyway all fixed now and I'm grinning again :-)
Three days messing about, all for a pair of square braces!
Kind regards Adrian
-- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com
----- Paul Graydon Network Technician Haywards Heath Sixth Form College http://www.hhc.ac.uk (01444) 456281
In the end, we will remember not the words of our enemies, but the silence of our friends. - Martin Luther King Jr. (1929 - 1968)
-- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com
-- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com
----- Paul Graydon Network Technician Haywards Heath Sixth Form College http://www.hhc.ac.uk (01444) 456281
In the end, we will remember not the words of our enemies, but the silence of our friends. - Martin Luther King Jr. (1929 - 1968)
-- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com
-- To unsubscribe, e-mail: suse-linux-uk-schools-unsubscribe@suse.com For additional commands, e-mail: suse-linux-uk-schools-help@suse.com ----- Paul Graydon Network Technician Haywards Heath Sixth Form College http://www.hhc.ac.uk (01444) 456281 In the end, we will remember not the words of our enemies, but the silence of our friends. - Martin Luther King Jr. (1929 - 1968)