Re: [PHP] DOCUMENT_ROOT disappeared on me!
David E. Weekly wrote: IMHO you're better off I agree and understand why, but... but yes, if you set register_globals = on then you shouldn't need to have retooled your scripts. I agree. =) Did you restart your webserver after you adjusted php.ini? Yes. Full stop/start cycle. And you're sure to be out of any caching? regards Jesper Brunholm -- Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Seperating presentation from logic
John Holmes wrote: You really want a template system. Check out Smarty or patTemplate. Devshed.com has a nice two part tutorial on patTemplate and I like how it looks a little better than Smarty right now. Might want to evaluate both and see which is faster or easier. Great idea - except that... when you've taught your designer to use the template system you've ofte used about the amount of time it would take to give him enough knowledge about php to go directly into the code the way that Freeman suggested... Regards Jesper Brunholm -- Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: setlocale() and local date
Hello Nick Nick Wilson wrote: Having trouble with setlocale() and displaying a local date in my php. setlocale(LC_ALL, dk_DK); I'm using: setlocale(LC_TIME, 'danish'); which works fine for me... btw: if you speak Danish then the dk.edb.internet.webdesign.serverside.php might be worthwile diving into :-) regards Jesper Brunholm -- Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP and OOP
[EMAIL PROTECTED] wrote: i want to build a site in fully OO style but that will significantly slow down execution time Do you have any documentation on this? - I'm getting quite used to read and hear the very opposite. Previously programmers even argued that asp was faster than php because it was more OO. Regards Jesper Brunholm -- Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Easy Date MySQL Question...
John Holmes wrote: I have searched the php.net and don't know where to look for the code Yes? - but you did not try searching with the keyword date or how? Even a search in Google with php date returns the manual's page with date() as first response... BUT the mysql-manual: http://www.mysql.com/doc/D/a/Date_and_time_functions.html is often a good thing to know when matters concern queryes... Do the formatting in your query. Use the MySQL function DATE_FORMAT(). Look it up in the MySQL manual, chapter 6: Date and Time Functions... ---John Holmes... Regards Jesper Brunholm -- Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: ARRAY, IF INSERT
César aracena wrote: The catch would be to make PHP to auto assign the relatives level by knowing it has to start from $i=1 and loop $i++ until no other kid is inserted. Now that I write it, it seems I could use a for loop, but what should be the structure of it using the $name 0 you told me? the name 0 was a sql-query - it will return a ressource which will enable you to make something like $i=0; while($row = mysql_fetch_assoc($nameless_result){ #psuedo-code# # mysql_query=(insert into table set relativenumber = 'jr$i' where ID=$row[ID]); } regards Jesper Brunholm btw: please do not write to my private email -- Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: recommend any good learning books
[EMAIL PROTECTED] wrote: I am coming over from Perl life. Does anyone recommend any good beginners books on learning PHP? I am looking for something similar too learning perl from Oreily. I must confess that I do not know the O'reilly book you're talking about, but PHP MySQL development from SAMS is a good book both as a reference, basic intro and has a lot of in-depth examples. Furthermore, it has a rather fine introduction to OO-programming in php regards Jesper Brunholm -- Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: ARRAY, IF INSERT
(i am new to these groups, but shouldn't there be a follow-up-to on a X-post?) César aracena wrote: I have this form in which one Administrator can insert new members and after that, in another page, a form where he/she can insert the new members sons daughters. I want to display a table with text inserts into the admin can type lets say a maximum of 5 kids in the second page. The number doesn't matter if you design you db well (I suppose we are talking database). I suppose that you have a table with members with unique ID's? Make a new table with relatives, where you connect to their parents through a ParentID-field This way you'll avoid empty fields for the folks with eg. only 2 sons :-) The query for father + sons and daughters would then be like mysql_query( select members.Name, members.ID, relatives.Name as RelativeName, relatives.ID from parents, relatives where parents.ID = relatives.ParentID ) The members table will have one memberID field (which will be shared between parents and kids) and a levelID which will grant 0 for the parent and 1, 2, 3, 4, 5 for the kids. You _can_ put them all in the same table, but I suppose that you have a lot of data stored on the parents/members, that is non-existing and irellevant for the children - this will give a lot of empty fields, which is why i propose the solution above... Now, how do I tell PHP to make an array from the kids input, but only from the fields in which lets say the name field was filled out in order to spend the necessary tables rows. Another thing the Array should also specify new levelIDs for each kid from 1 to 5. It would be great if you also show me how to deal with it after its created. It's easy to select only rows with contents for at certain field: select * from relatives where Name 0 I hope this was of some help? regards Jesper Brunholm -- Phønix - Danish folkmusic from young musicians - http://www.phonixfolk.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stumped on a function
John Holmes wrote: Why don't you just use DATE_FORMAT() in your query, then you don't have to do any extra PHP code at all?? you might want a link to that: http://www.mysql.com/doc/D/a/Date_and_time_functions.html - look somewhat below the middle of the page function cleandate($indate) { str_replace(-, /, $indate); return date(F j, Y, strtotime($indate)); } check the $indate - response from the db - if you give invalid data there then it will (probably) use a timestamp instead, whith now()-values... when I echo $newdate using the above code, I get June 20, 2002 - today's date. Regards Jesper Brunholm -- Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php