php-general Digest 12 Dec 2008 15:17:04 -0000 Issue 5841
php-general Digest 12 Dec 2008 15:17:04 - Issue 5841 Topics (messages 284520 through 284541): Re: Foreign Keys Question 284520 by: Waynn Lue 284521 by: Chris 284524 by: clive 284525 by: Robert Cummings 284526 by: clive 284527 by: Waynn Lue 284533 by: Boyd, Todd M. 284537 by: tedd 284538 by: tedd 284539 by: Colin Guthrie 284541 by: tedd Re: Need a brain to bounce some Mysql/DB thoughts off of!! 284522 by: German Geek 284530 by: Jay Blanchard 284531 by: Jay Blanchard 284540 by: tedd How serialize DOMDocument object? 284523 by: íÉÈÁÉÌ çÁ×ÒÉÌÏ× 284528 by: Colin Guthrie Chrome 1.0 released 284529 by: Richard Heyes Re: Poll of Sorts: Application Frameworks--Zend, Cake etc 284532 by: Terion Miller 284534 by: Peter Ford 284535 by: Boyd, Todd M. 284536 by: Colin Guthrie 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 -- ---BeginMessage--- As a side note, FKs do enforce other table specific properties like indexes on the fields being constrained, so they do add value there as well. But there's of course an extra cost on updates and inserts to see if the FK is violated. Waynn On 12/11/08, Colin Guthrie gm...@colin.guthr.ie wrote: 'Twas brillig, and Chris at 12/12/08 01:20 did gyre and gimble: Micah Gersten wrote: Colin Guthrie wrote: The ON DELETE CASCADE option is key here... DELETE FROM students where student_id=1 will remove all traces of that student from the db... all the course they've attended, all the instructors who have taught them etc. keeps things nice and tidy without having to put the structure in your code all over the place. Col Why would you want to delete the instructors when deleting the student? I think he meant the link between the student instructor (in the student_instructor table), not the instructor itself. lol, indeed, that's what I meant... Sorry I thought it was implied in the context! Say you have the following layouts instructors: instructor_id, name students: student_id, name instructor_students: instructor_id, student_id This structure would hold a list of instructors and a list of studends and also a one to many mapping of instructors to students. If you delete a student the FK can cascade to the instructor_students table and thus delete the records that indicate a given instructor (or instructors) taught them. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Waynn Lue wrote: As a side note, FKs do enforce other table specific properties like indexes on the fields being constrained, so they do add value there as well. But there's of course an extra cost on updates and inserts to see if the FK is violated. On the external table? No they don't. mysql create table t1(id int primary key, name varchar(255)) engine=innodb; Query OK, 0 rows affected (0.00 sec) mysql create table t2(t2id int, t1id int references t1(id)) engine=innodb; Query OK, 0 rows affected (0.00 sec) mysql show create table t2\G *** 1. row *** Table: t2 Create Table: CREATE TABLE `t2` ( `t2id` int(11) default NULL, `t1id` int(11) default NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (0.00 sec) No auto-index on t2(t1id) at all. You have to define that yourself - you might want it part of a multi-column index for example. You definitely should index it, but it won't happen automatically. -- Postgresql php tutorials http://www.designmagick.com/ ---End Message--- ---BeginMessage--- Colin Guthrie wrote: 'Twas brillig, and tedd at 11/12/08 18:46 did gyre and gimble: As for my Foreign Keys Question, I think the answer is that it enforces rules upon the configuration (i.e., deleting, altering, and such), but does not provide any significant service beyond that. Well that's a fairly significant service in itself. The whole deleting data case is where FK's have saved me significant amount of coding. The ON DELETE CASCADE option is key here... DELETE FROM students where student_id=1 will remove all traces of that student from the db... all the course they've attended, all the instructors who have taught them etc. keeps things nice and tidy
php-general Digest 13 Dec 2008 03:24:35 -0000 Issue 5842
php-general Digest 13 Dec 2008 03:24:35 - Issue 5842 Topics (messages 284542 through 284573): Re: Need a brain to bounce some Mysql/DB thoughts off of!! 284542 by: Robert Cummings 284545 by: ceo.l-i-e.com 284546 by: Daniel Brown 284547 by: Frank Stanovcak 284550 by: Robert Cummings Re: Foreign Keys Question 284543 by: phphelp -- kbk 284553 by: Colin Guthrie 284555 by: tedd Question on if() priorities 284544 by: Frank Stanovcak 284548 by: Maciek Sokolewicz 284549 by: Maciek Sokolewicz 284551 by: Frank Stanovcak 284552 by: Frank Stanovcak Re: Chrome 1.0 released 284554 by: Dotan Cohen 284556 by: Richard Heyes 284557 by: Robert Cummings 284559 by: Dotan Cohen Credit Card processing: Chase PaymenTech 284558 by: phphelp -- kbk question on parameter specification in href tag 284560 by: Xaver Thum 284561 by: Robert Cummings 284562 by: Daniel Brown 284563 by: Xaver Thum Using a class inside of a class 284564 by: Richard Kurth 284573 by: Robert Cummings Resource ID# 5 and Resource id #5 8561 errorshelp 284565 by: Terion Miller 284566 by: Daniel P. Brown 284567 by: Terion Miller 284568 by: Terion Miller 284569 by: Daniel P. Brown 284570 by: Terion Miller 284571 by: Jim Lucas Instructions on compiling PHP 5.2.8 for Mac OS X Server 10.4.11 284572 by: Rene Fournier 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 -- ---BeginMessage--- On Fri, 2008-12-12 at 06:34 -0600, Jay Blanchard wrote: [snip] It's Christmas... the season of giving and tolerance :| [/snip] We will return you to your regularly scheduled Robert Cummings Jan 2nd, 2009 Are you suggesting I'm not tolerant? Pfff. :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP ---End Message--- ---BeginMessage--- I would set it up that a person could elect to work with one or more Departments. If they work on a College, they work on all Departments in that college. Another option is to just let them do one Dept at a time, and that's it. Kind of depends on what people actually DO in this work, most of the time. If the whole-college work is rare, then don't bother with it. ---End Message--- ---BeginMessage--- On Fri, Dec 12, 2008 at 10:35, Robert Cummings rob...@interjinn.com wrote: Are you suggesting I'm not tolerant? Pfff. Not since you've let those crosses on the lawn burn out. ;-P And yet, despite all of this, poor ol' php...@lists.php.net is left in the cold. -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php ---End Message--- ---BeginMessage--- Robert Cummings rob...@interjinn.com wrote in message news:1229096146.22284.27.ca...@localhost... On Fri, 2008-12-12 at 06:34 -0600, Jay Blanchard wrote: [snip] It's Christmas... the season of giving and tolerance :| [/snip] We will return you to your regularly scheduled Robert Cummings Jan 2nd, 2009 Are you suggesting I'm not tolerant? Pfff. :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP if you break it down he actually said you are very tollerant, but there is an explicit limiter of Jan 2nd on the degree of tollerance supplied by the said Cummings system. ---End Message--- ---BeginMessage--- On Fri, 2008-12-12 at 11:02 -0500, Daniel Brown wrote: On Fri, Dec 12, 2008 at 10:35, Robert Cummings rob...@interjinn.com wrote: Are you suggesting I'm not tolerant? Pfff. Not since you've let those crosses on the lawn burn out. ;-P Those aren't crosses... they're plus symbols, I was teaching my son basic addition when suddenly a bolt of lightning smacked our car, which then exploded and splashed our symbols with burning gasoline and car wreckage. Yeah, that's what REEALLY happened! And yet, despite all of this, poor ol' php...@lists.php.net is left in the cold. There's a php-db list? What for? ;) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP ---End Message--- ---BeginMessage--- In my enrollment database, we keep historical information. My client is a big computer training organization (for which I also teach). The enrollment information is quite fluid -- people are always canceling or rescheduling. It is important for us to know a person's history. $.02 Ken On Dec 12, 2008, at 9:16 AM, tedd wrote: At 2:50 PM + 12/12/08, Colin Guthrie wrote: 'Twas brillig, and tedd
Re: [PHP] Foreign Keys Question
Waynn Lue wrote: As a side note, FKs do enforce other table specific properties like indexes on the fields being constrained, so they do add value there as well. But there's of course an extra cost on updates and inserts to see if the FK is violated. On the external table? No they don't. mysql create table t1(id int primary key, name varchar(255)) engine=innodb; Query OK, 0 rows affected (0.00 sec) mysql create table t2(t2id int, t1id int references t1(id)) engine=innodb; Query OK, 0 rows affected (0.00 sec) mysql show create table t2\G *** 1. row *** Table: t2 Create Table: CREATE TABLE `t2` ( `t2id` int(11) default NULL, `t1id` int(11) default NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (0.00 sec) No auto-index on t2(t1id) at all. You have to define that yourself - you might want it part of a multi-column index for example. You definitely should index it, but it won't happen automatically. Hm, that's weird. Which version of mysql are you using? According to http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html: InnoDB requires indexes on foreign keys and referenced keys so that foreign key checks can be fast and not require a table scan. In the referencing table, there must be an index where the foreign key columns are listed as the *first* columns in the same order. Such an index is created on the referencing table automatically if it does not exist. (This is in contrast to some older versions, in which indexes had to be created explicitly or the creation of foreign key constraints would fail.) *index_name*, if given, is used as described previously.
[PHP] Re: How serialize DOMDocument object?
'Twas brillig, and Михаил Гаврилов at 12/12/08 06:23 did gyre and gimble: How serialize DOMDocument object? Easiest way is to save it to an XML string and then load it again. If you want a conveneinet way to store domdocuments in the session, then just extend the class and define __sleep and __wakup functions that essentially do the save/load for you. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Need a brain to bounce some Mysql/DB thoughts off of!!
[snip] I guess, if people get more responses here, it shows that this mailing list is superior (no offence to the MySQL list :-P ). [/snip] Duh. Was there ever any question? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Chrome 1.0 released
Hi, Well it's not really related to PHP, but certainly web development in general. Personally, I was surprised by the jump from 0.4 to 1.0. Judging by other Google betas (eg Gmail) I was expecting it to be in beta for the next decade or so. -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated December 5th) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Need a brain to bounce some Mysql/DB thoughts off of!!
[snip] It's Christmas... the season of giving and tolerance :| [/snip] We will return you to your regularly scheduled Robert Cummings Jan 2nd, 2009 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Poll of Sorts: Application Frameworks--Zend, Cake etc
On Thu, Dec 11, 2008 at 4:25 PM, Colin Guthrie gm...@colin.guthr.ie wrote: 'Twas brillig, and Terion Miller at 11/12/08 14:56 did gyre and gimble: Hey Everyone, I am wondering if using a framework such as one of these may make my life easier, which do any of you use and what has been your experience with the learning curve of them? I just put Cake on my local server, basically I want to know which is easiest? LOL... Personally I'm a ZF fan, but each to their own. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Thanks for the responses, CakePhp was seemingly very easy for me to catch on to and get started in (which means its super super easy folks) unfortunately when I got to the viewing of my files (pretty important) I couldn't get the IIS (yep I know sucks) to work with it, and I installed a mod_rewrite.dll for IIS and everything along with setting it to Cakes pretty urls and removing the htdocs, but then it just kept resolving all urls to the root ... no matter what I changed the path to, and no matter if I set it only to that directory...so by end of day yesterday I downloaded the zend and will attempt to see what I can do with it, I want off this windows box but that isn't going to happen anytime soon ...sigh... Terion
RE: [PHP] Re: Foreign Keys Question
-Original Message- From: clive [mailto:clive_li...@immigrationunit.com] Sent: Friday, December 12, 2008 1:07 AM To: PHP LIST Subject: Re: [PHP] Re: Foreign Keys Question Colin Guthrie wrote: 'Twas brillig, and tedd at 11/12/08 18:46 did gyre and gimble: As for my Foreign Keys Question, I think the answer is that it enforces rules upon the configuration (i.e., deleting, altering, and such), but does not provide any significant service beyond that. Well that's a fairly significant service in itself. The whole deleting data case is where FK's have saved me significant amount of coding. The ON DELETE CASCADE option is key here... DELETE FROM students where student_id=1 will remove all traces of that student from the db... all the course they've attended, all the instructors who have taught them etc. keeps things nice and tidy without having to put the structure in your code all over the place. Col Is it just me or does anyone else here not like deleting from a database, I normally have a status field to indicated if a row has been deleted. What about historical data, would you not want to know that studentX was enrolled at some point in the past, if you just delete that student and all related data how would you know this? You could also have a 2nd database with the same table structure and move old/delete data into there. You are describing a data warehouse, or a data mart. That is not what transactional databases are there for. Make a historical database, and make a transactional database... but don't make one that tries to be both, or you're just shooting yourself in the foot. // Todd
Re: [PHP] Re: Poll of Sorts: Application Frameworks--Zend, Cake etc
Terion Miller wrote: On Thu, Dec 11, 2008 at 4:25 PM, Colin Guthrie gm...@colin.guthr.ie wrote: 'Twas brillig, and Terion Miller at 11/12/08 14:56 did gyre and gimble: Hey Everyone, I am wondering if using a framework such as one of these may make my life easier, which do any of you use and what has been your experience with the learning curve of them? I just put Cake on my local server, basically I want to know which is easiest? LOL... Personally I'm a ZF fan, but each to their own. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Thanks for the responses, CakePhp was seemingly very easy for me to catch on to and get started in (which means its super super easy folks) unfortunately when I got to the viewing of my files (pretty important) I couldn't get the IIS (yep I know sucks) to work with it, and I installed a mod_rewrite.dll for IIS and everything along with setting it to Cakes pretty urls and removing the htdocs, but then it just kept resolving all urls to the root ... no matter what I changed the path to, and no matter if I set it only to that directory...so by end of day yesterday I downloaded the zend and will attempt to see what I can do with it, I want off this windows box but that isn't going to happen anytime soon ...sigh... Terion If you're up for a bit of playing, look at www.virtualbox.org and set up a virtual linux box inside your windows server. I got a nice new laptop to play with for setting up a demo of one of our web-apps, and since it had Vista (and was high enough spec to handle it) I just put VirtualBox on board and installed OpenSuSE in there to run the server side of the app. A bit of fiddling with network bridges (all documented by the VirtualBox people) and the server is visible just like it was a real machine... So I can take this machine around, and (without needing any network connection) show off the app in IE, Firefox, Opera or Chrome without having to run IIS. Well, I thought it was cool, anyway :( -- Peter Ford phone: 01580 89 Developer fax: 01580 893399 Justcroft International Ltd., Staplehurst, Kent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Poll of Sorts: Application Frameworks--Zend, Cake etc
-Original Message- From: Terion Miller [mailto:webdev.ter...@gmail.com] Sent: Friday, December 12, 2008 7:55 AM To: Colin Guthrie Cc: php-general@lists.php.net Subject: Re: [PHP] Re: Poll of Sorts: Application Frameworks--Zend, Cake etc On Thu, Dec 11, 2008 at 4:25 PM, Colin Guthrie gm...@colin.guthr.ie wrote: 'Twas brillig, and Terion Miller at 11/12/08 14:56 did gyre and gimble: Hey Everyone, I am wondering if using a framework such as one of these may make my life easier, which do any of you use and what has been your experience with the learning curve of them? I just put Cake on my local server, basically I want to know which is easiest? LOL... Personally I'm a ZF fan, but each to their own. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Thanks for the responses, CakePhp was seemingly very easy for me to catch on to and get started in (which means its super super easy folks) unfortunately when I got to the viewing of my files (pretty important) I couldn't get the IIS (yep I know sucks) to work with it, and I installed a mod_rewrite.dll for IIS and everything along with setting it to Cakes pretty urls and removing the htdocs, but then it just kept resolving all urls to the root ... no matter what I changed the path to, and no matter if I set it only to that directory...so by end of day yesterday I downloaded the zend and will attempt to see what I can do with it, I want off this windows box but that isn't going to happen anytime soon ...sigh... I recommend the Ionic ISAPI Rewrite Filter [1]. Also, this [2] webpage can probably help you with your Cake/IIS configuration, although they use a different rewrite filter [3]. 1. http://www.codeplex.com/IIRF 2. http://bakery.cakephp.org/articles/view/cakephp-on-iis 3. http://www.creativepark.it/downloads/iismod_rewrite.zip HTH, // Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Poll of Sorts: Application Frameworks--Zend, Cake etc
'Twas brillig, and Terion Miller at 12/12/08 13:55 did gyre and gimble: Thanks for the responses, CakePhp was seemingly very easy for me to catch on to and get started in (which means its super super easy folks) unfortunately when I got to the viewing of my files (pretty important) I couldn't get the IIS (yep I know sucks) to work with it, and I installed a mod_rewrite.dll for IIS and everything along with setting it to Cakes pretty urls and removing the htdocs, but then it just kept resolving all urls to the root ... no matter what I changed the path to, and no matter if I set it only to that directory...so by end of day yesterday I downloaded the zend and will attempt to see what I can do with it, I want off this windows box but that isn't going to happen anytime soon ...sigh... I hate to say but I suspect you'll be in a similar boat with Zend... perhaps not, but I certainly make fairly extensive use of rewrite rules to direct all my URLs to my main Zend bootstrap. Just out of curiosity, are you stuck to that specific windows box (e.g. is that what you have to host on in a live env?) or is it just that you need to use the machine for devel? Reason I ask is that it's pretty trivial to install Apache, PHP and MySQL on windows there are even some packages that make it ultra easy to install e.g.: http://www.apachefriends.org/en/xampp-windows.html I don't use it personally (thankfully don't use windows unless I'm poked with a pointy stick!) but I hear good things. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Foreign Keys Question
At 4:25 PM -0500 12/11/08, Robert Cummings wrote: On Thu, 2008-12-11 at 16:24 -0500, Robert Cummings wrote: lock table check enrolment count no room unlock table generate error have room insert row unlock table Ba da boom. I should have read your message better... you were talking about skipping transactions and not locking :) Cheers, Rob. Rob: I was talking about both -- you answer was fine. Thanks, 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
[PHP] Re: Foreign Keys Question
At 10:24 PM + 12/11/08, Colin Guthrie wrote: 'Twas brillig, and tedd at 11/12/08 18:46 did gyre and gimble: As for my Foreign Keys Question, I think the answer is that it enforces rules upon the configuration (i.e., deleting, altering, and such), but does not provide any significant service beyond that. Well that's a fairly significant service in itself. The whole deleting data case is where FK's have saved me significant amount of coding. The ON DELETE CASCADE option is key here... DELETE FROM students where student_id=1 will remove all traces of that student from the db... all the course they've attended, all the instructors who have taught them etc. keeps things nice and tidy without having to put the structure in your code all over the place. Col Col: That's neat and a lot more powerful than I thought. It's like following a linked list to it's end while removing all traces of the thread. And I understand the instructor delete was not intended. Thanks, 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
[PHP] Re: Foreign Keys Question
'Twas brillig, and tedd at 12/12/08 14:36 did gyre and gimble: That's neat and a lot more powerful than I thought. It's like following a linked list to it's end while removing all traces of the thread. Exactly And I understand the instructor delete was not intended. Yeah indeed. I had a db structure in my head and the statement made vague sense with that in mind, but it totally failed to leak through my hands on to the keyboard :P There are three main options here: * ON DELETE CASCADE (if the FK's referenced table has it's record deleted, delete the record here too). * ON DELETE RESTRICT (if the FK's referenced table has it's record deleted stop that whole transaction - e.g. *prevent* the delete). * ON DELETE SET NULL (if the FK's referenced table has it's record deleted, set this tables reference to NULL). All three are useful in different contexts. I use them extensively to ensure good data integrity. The trade off on extra load on insert/update is IMO well worth it. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Need a brain to bounce some Mysql/DB thoughts off of!!
At 6:34 AM -0600 12/12/08, Jay Blanchard wrote: [snip] It's Christmas... the season of giving and tolerance :| [/snip] We will return you to your regularly scheduled Robert Cummings Jan 2nd, 2009 In either event, the answers are still good. As for MySQL questions on this list, as I said previously, this list provides more answers than the MySQL list. Again no offense meant to that list -- for there are some very bright people there. However, this list is more responsive; more specific re MySQL queries; and entertains a holistic view of how to design and apply solutions considering more than a single language. This is absolutely the best list for web programming problems. 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
[PHP] Re: Foreign Keys Question
At 2:50 PM + 12/12/08, Colin Guthrie wrote: 'Twas brillig, and tedd at 12/12/08 14:36 did gyre and gimble: That's neat and a lot more powerful than I thought. It's like following a linked list to it's end while removing all traces of the thread. Exactly And I understand the instructor delete was not intended. Yeah indeed. I had a db structure in my head and the statement made vague sense with that in mind, but it totally failed to leak through my hands on to the keyboard :P There are three main options here: * ON DELETE CASCADE (if the FK's referenced table has it's record deleted, delete the record here too). * ON DELETE RESTRICT (if the FK's referenced table has it's record deleted stop that whole transaction - e.g. *prevent* the delete). * ON DELETE SET NULL (if the FK's referenced table has it's record deleted, set this tables reference to NULL). All three are useful in different contexts. I use them extensively to ensure good data integrity. The trade off on extra load on insert/update is IMO well worth it. Col Col: That's all good to know. My first tendency is to keep everything. After all, memory is cheap and access times are always reducing. While it's true that having a bunch of worthless data doesn't accomplish anything and slows the process of dealing with it. But, technology in access times and storage capabilities are getting to the point of making the decision to keep/delete worthless data moot. As such, I think the need for FK deletions will become less and perhaps disappear from the language. For some reason, I look upon deletions in similar light as renumbering a table's index after deletion of a record -- like what's the point? I'm just rambling -- thanks again for your insight. 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
RE: [PHP] Need a brain to bounce some Mysql/DB thoughts off of!!
On Fri, 2008-12-12 at 06:34 -0600, Jay Blanchard wrote: [snip] It's Christmas... the season of giving and tolerance :| [/snip] We will return you to your regularly scheduled Robert Cummings Jan 2nd, 2009 Are you suggesting I'm not tolerant? Pfff. :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Foreign Keys Question
In my enrollment database, we keep historical information. My client is a big computer training organization (for which I also teach). The enrollment information is quite fluid -- people are always canceling or rescheduling. It is important for us to know a person's history. $.02 Ken On Dec 12, 2008, at 9:16 AM, tedd wrote: At 2:50 PM + 12/12/08, Colin Guthrie wrote: 'Twas brillig, and tedd at 12/12/08 14:36 did gyre and gimble: That's neat and a lot more powerful than I thought. It's like following a linked list to it's end while removing all traces of the thread. Exactly And I understand the instructor delete was not intended. Yeah indeed. I had a db structure in my head and the statement made vague sense with that in mind, but it totally failed to leak through my hands on to the keyboard :P There are three main options here: * ON DELETE CASCADE (if the FK's referenced table has it's record deleted, delete the record here too). * ON DELETE RESTRICT (if the FK's referenced table has it's record deleted stop that whole transaction - e.g. *prevent* the delete). * ON DELETE SET NULL (if the FK's referenced table has it's record deleted, set this tables reference to NULL). All three are useful in different contexts. I use them extensively to ensure good data integrity. The trade off on extra load on insert/update is IMO well worth it. Col Col: That's all good to know. My first tendency is to keep everything. After all, memory is cheap and access times are always reducing. While it's true that having a bunch of worthless data doesn't accomplish anything and slows the process of dealing with it. But, technology in access times and storage capabilities are getting to the point of making the decision to keep/delete worthless data moot. As such, I think the need for FK deletions will become less and perhaps disappear from the language. For some reason, I look upon deletions in similar light as renumbering a table's index after deletion of a record -- like what's the point? I'm just rambling -- thanks again for your insight. 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question on if() priorities
I can't seem to find a reference to this in the manual, but is there an order of precedence for and or xor in an if statement? Kind of like PPMDAS or polish notation for math (PPMDAS = Powers. Parenthacies. Multiplication...) I ask because this seems to be working for me, but I want to make sure it is doing what I think it is. (code follows) if((($FILTERED['cod1'] == 0) or ($FILTERED['cod1'] == 1)) and (($FILTERED['cod2'] == 0) or ($FILTERED['cod2'] == 2)) and (($FILTERED['cod3'] == 0) or ($FILTERED['cod3'] == 4))) (end code) which is if either of the first set, and either of the second set, and either of the third set is true return true. Thanks in advance! Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a brain to bounce some Mysql/DB thoughts off of!!
I would set it up that a person could elect to work with one or more Departments. If they work on a College, they work on all Departments in that college. Another option is to just let them do one Dept at a time, and that's it. Kind of depends on what people actually DO in this work, most of the time. If the whole-college work is rare, then don't bother with it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a brain to bounce some Mysql/DB thoughts off of!!
Robert Cummings rob...@interjinn.com wrote in message news:1229096146.22284.27.ca...@localhost... On Fri, 2008-12-12 at 06:34 -0600, Jay Blanchard wrote: [snip] It's Christmas... the season of giving and tolerance :| [/snip] We will return you to your regularly scheduled Robert Cummings Jan 2nd, 2009 Are you suggesting I'm not tolerant? Pfff. :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP if you break it down he actually said you are very tollerant, but there is an explicit limiter of Jan 2nd on the degree of tollerance supplied by the said Cummings system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question on if() priorities
Frank Stanovcak wrote: I can't seem to find a reference to this in the manual, but is there an order of precedence for and or xor in an if statement? Kind of like PPMDAS or polish notation for math (PPMDAS = Powers. Parenthacies. Multiplication...) I ask because this seems to be working for me, but I want to make sure it is doing what I think it is. (code follows) if((($FILTERED['cod1'] == 0) or ($FILTERED['cod1'] == 1)) and (($FILTERED['cod2'] == 0) or ($FILTERED['cod2'] == 2)) and (($FILTERED['cod3'] == 0) or ($FILTERED['cod3'] == 4))) (end code) which is if either of the first set, and either of the second set, and either of the third set is true return true. Thanks in advance! Frank http://nl.php.net/manual/en/language.operators.php#language.operators.precedence -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a brain to bounce some Mysql/DB thoughts off of!!
On Fri, 2008-12-12 at 11:02 -0500, Daniel Brown wrote: On Fri, Dec 12, 2008 at 10:35, Robert Cummings rob...@interjinn.com wrote: Are you suggesting I'm not tolerant? Pfff. Not since you've let those crosses on the lawn burn out. ;-P Those aren't crosses... they're plus symbols, I was teaching my son basic addition when suddenly a bolt of lightning smacked our car, which then exploded and splashed our symbols with burning gasoline and car wreckage. Yeah, that's what REEALLY happened! And yet, despite all of this, poor ol' php...@lists.php.net is left in the cold. There's a php-db list? What for? ;) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question on if() priorities
Thanks. Don't know how I could have missed that. Maciek Sokolewicz tula...@php.net wrote in message news:49428d51.3090...@php.net... Frank Stanovcak wrote: I can't seem to find a reference to this in the manual, but is there an order of precedence for and or xor in an if statement? Kind of like PPMDAS or polish notation for math (PPMDAS = Powers. Parenthacies. Multiplication...) I ask because this seems to be working for me, but I want to make sure it is doing what I think it is. (code follows) if((($FILTERED['cod1'] == 0) or ($FILTERED['cod1'] == 1)) and (($FILTERED['cod2'] == 0) or ($FILTERED['cod2'] == 2)) and (($FILTERED['cod3'] == 0) or ($FILTERED['cod3'] == 4))) (end code) which is if either of the first set, and either of the second set, and either of the third set is true return true. Thanks in advance! Frank http://nl.php.net/manual/en/language.operators.php#language.operators.precedence -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Foreign Keys Question
'Twas brillig, and tedd at 12/12/08 15:16 did gyre and gimble: My first tendency is to keep everything. After all, memory is cheap and access times are always reducing. While it's true that having a bunch of worthless data doesn't accomplish anything and slows the process of dealing with it. But, technology in access times and storage capabilities are getting to the point of making the decision to keep/delete worthless data moot. As such, I think the need for FK deletions will become less and perhaps disappear from the language. For some reason, I look upon deletions in similar light as renumbering a table's index after deletion of a record -- like what's the point? I'm just rambling -- thanks again for your insight. Rambling is good... I'll continue! With data retention and data protection laws (something that can vary around the world making life for web-based providers like ourselves even more complex), I think it is increasingly important that information about a given person can be scrubbed very easily. Keeping the data may be cheap from a storage/access perspective, but complying with laws and regulations can be wearisome and time consuming. If you FKs are fully up-to-date and have proper cascading you can be sure that a simple: DELETE FROM users WHERE user_id=123; really will delete all the information you store about that individual. You just have to look at the hullabaloo over the deactivated Facebook accounts etc. to realise that hiding or disabling data is not enough in many cases. Food for thought! Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited [http://www.tribalogic.net/] Open Source: Mandriva Linux Contributor [http://www.mandriva.com/] PulseAudio Hacker [http://www.pulseaudio.org/] Trac Hacker [http://trac.edgewall.org/] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need a brain to bounce some Mysql/DB thoughts off of!!
On Fri, Dec 12, 2008 at 10:35, Robert Cummings rob...@interjinn.com wrote: Are you suggesting I'm not tolerant? Pfff. Not since you've let those crosses on the lawn burn out. ;-P And yet, despite all of this, poor ol' php...@lists.php.net is left in the cold. -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Chrome 1.0 released
2008/12/12 Richard Heyes rich...@php.net: Well it's not really related to PHP, but certainly web development in general. Personally, I was surprised by the jump from 0.4 to 1.0. Judging by other Google betas (eg Gmail) I was expecting it to be in beta for the next decade or so. As seen on ./, it seems that Google may be pressing OEMs to include Chrome bundled on new computers. That cannot happen with a beta web browser. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
[PHP] Re: Foreign Keys Question
At 4:34 PM + 12/12/08, Colin Guthrie wrote: 'Twas brillig, and tedd at 12/12/08 15:16 did gyre and gimble: My first tendency is to keep everything. After all, memory is cheap and access times are always reducing. While it's true that having a bunch of worthless data doesn't accomplish anything and slows the process of dealing with it. But, technology in access times and storage capabilities are getting to the point of making the decision to keep/delete worthless data moot. As such, I think the need for FK deletions will become less and perhaps disappear from the language. For some reason, I look upon deletions in similar light as renumbering a table's index after deletion of a record -- like what's the point? I'm just rambling -- thanks again for your insight. Rambling is good... I'll continue! With data retention and data protection laws (something that can vary around the world making life for web-based providers like ourselves even more complex), I think it is increasingly important that information about a given person can be scrubbed very easily. Keeping the data may be cheap from a storage/access perspective, but complying with laws and regulations can be wearisome and time consuming. If you FKs are fully up-to-date and have proper cascading you can be sure that a simple: DELETE FROM users WHERE user_id=123; really will delete all the information you store about that individual. You just have to look at the hullabaloo over the deactivated Facebook accounts etc. to realise that hiding or disabling data is not enough in many cases. Food for thought! Col Col: I'll continue rambling. Excellent point -- Yes, I forgot about security issues. For example most on-line credit card processing agreements state that you must delete the actual credit card information (i.e., cc and cvs numbers) within 24 hours of a customer's purchase. I often have problems explaining that to clients who want to keep such information on-line. I tell them what they do with the hard copy of that information is their business, but I'm not going to jail to keep that data in a database for them. Anyone else experienced that problem? And if so, how did you handle it? 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
Re: [PHP] Chrome 1.0 released
As seen on ./, it seems that Google may be pressing OEMs to include Chrome bundled on new computers. That cannot happen with a beta web browser. Great. Can't fault them. Even in its beta state, I think it's better than MSIE. I still use Firefox though... -- Richard Heyes HTML5 Graphing for FF, Chrome, Opera and Safari: http://www.rgraph.org (Updated December 5th) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Chrome 1.0 released
On Fri, 2008-12-12 at 18:39 +0200, Dotan Cohen wrote: 2008/12/12 Richard Heyes rich...@php.net: Well it's not really related to PHP, but certainly web development in general. Personally, I was surprised by the jump from 0.4 to 1.0. Judging by other Google betas (eg Gmail) I was expecting it to be in beta for the next decade or so. As seen on ./, it seems that Google may be pressing OEMs to include Chrome bundled on new computers. That cannot happen with a beta web browser. Do you mean as seen on /. ? Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Credit Card processing: Chase PaymenTech
Hello - - --- -- - -- I need to develop Credit Card processing for my current application. We have our own shopping cart. We have been trying in vain to get technical information from PaymenTech for *months* -- but it seems that Chase sold part of it, or split it off into a separate company -- or something. in any case, they seem extremely distracted and unresponsive. By doing some heavy googling, I was able to find some code from a PHP developer's web site, mostly for the format of the xml strings to pass to them. I can't believe that they don't have a processing object for PHP already available, but it seems not. I see in the archives a couple of requests to the group for code, but the most recent was a couple of years old. So, I'll ask again: Anybody have modules, code, tips, land mines, or any other information for doing credit card processing with PaymenTech that you would be willing to share? Many thanks - - - Ken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Chrome 1.0 released
2008/12/12 Robert Cummings rob...@interjinn.com: Do you mean as seen on /. ? I do, at least.. at least I mean what I say... that's the same thing, you know. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-ي А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я ä-ö-ü-ß-Ä-Ö-Ü
[PHP] question on parameter specification in href tag
Hi, I want to set a link like a href=http://www.anyurl.com?mypar=17color=red; ... into my HTML file; that works fine. But if I specify a hex color like #CC instead of red, a href=http://www.anyurl.com?mypar=17color=#CC; ... the color is ignored (probably because # starts a PHP comment). Is there any workaround for this problem ? Thanks and Regards Xaver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] question on parameter specification in href tag
On Thu, 2008-12-11 at 11:30 +0100, Xaver Thum wrote: Hi, I want to set a link like a href=http://www.anyurl.com?mypar=17color=red; ... into my HTML file; that works fine. But if I specify a hex color like #CC instead of red, a href=http://www.anyurl.com?mypar=17color=#CC; ... the color is ignored (probably because # starts a PHP comment). Is there any workaround for this problem ? Thanks and Regards urlencode() Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] question on parameter specification in href tag
On Thu, Dec 11, 2008 at 05:30, Xaver Thum xaver.t...@t-online.de wrote: But if I specify a hex color like #CC instead of red, a href=http://www.anyurl.com?mypar=17color=#CC; ... the color is ignored (probably because # starts a PHP comment). Is there any workaround for this problem ? Hey, X; Actually, it's skipped because it's seen as a page anchor. That's a client-side only thing, and the browser would then be looking for: a name=CC id=CC/a Instead, skip the hashmark: a href=http://www.anyurl.com/?mypar=17color=CC; ... and have it parsed similarly to this: ?php if(strlen($_GET['color']) == 6 preg_match('/[a-f0-9]{6}/i',trim($_GET['color']))) { // Color is a legitimate HTML hexadecimal color $_GET['color'] = strtoupper($_GET['color']); // Set upper-case } else { // Color is not legit, was not supplied, or this may be a lame hack attempt $_GET['color'] = 'CC'; // Force default color } $color = '#'.$_GET['color']; ? -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: question on parameter specification in href tag
Hi, thanks for the quick solutions ! Regards Xaver Xaver Thum xaver.t...@t-online.de schrieb im Newsbeitrag news:9b.01.31950.6dbe0...@pb1.pair.com... Hi, I want to set a link like a href=http://www.anyurl.com?mypar=17color=red; ... into my HTML file; that works fine. But if I specify a hex color like #CC instead of red, a href=http://www.anyurl.com?mypar=17color=#CC; ... the color is ignored (probably because # starts a PHP comment). Is there any workaround for this problem ? Thanks and Regards Xaver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using a class inside of a class
Can I use another class inside of a function in a class this function process_queue below is inside of a class called class mailer I want to use the phpMailer class inside of this function so I can send email using smtp. Can this be done and is there any information out there on how to do this function process_queue($num=10){ if (isset($this-db_settings['demo']) and ($this-db_settings['demo'])){ return; } $q = $this-ams-db-query(SELECT * FROM {$this-ams-pre}email_queue WHERE queue_state = 0 ORDER BY queue_time_added ASC LIMIT $num); while ($row = $this-ams-db-nqfetch($q)){ $this-to = $row['queue_to']; $this-headers = $row['queue_headers']; $this-subject = $row['queue_subject']; $this-message = $row['queue_text']; $updateq = $this-ams-db-query(UPDATE {$this-ams-pre}email_queue SET queue_time_added = queue_time_added, queue_time_sent = NOW(), queue_state = -2 WHERE queue_id = {$row['queue_id']}); if (@mail($this-to, $this-subject, $this-message, $this-headers)){ $result = 1; } else{ $result = -1; } if ($this-ams-settings['email_debug']){ @mail ($this-ams-settings['site_email'], $this-subject, $this-message, $this-headers); } $updateq = $this-ams-db-query(UPDATE {$this-ams-pre}email_queue SET queue_time_added = queue_time_added, queue_time_sent = NOW(), queue_state = $result WHERE queue_id = {$row['queue_id']}); } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Resource ID# 5 and Resource id #5 8561 errors....help
Hey there, okay I ran into these and need some tips, pointers etc... First I was getting the Resource ID#5 error with this query: $query=SELECT * FROM importimages WHERE Category='Obits'; $result = mysql_query($query); so then I read how mysql_query returns a resource, so I tried this: $query = SELECT * FROM importimages WHERE Category='Obits' ; $result = mysql_query ($query); $arr = mysql_fetch_row($result); $result2 = $arr[0]; echo ($result2); when I echo the result2 I get: 8561 --no idea what the heck that is the next line is this and its giving me probs: while ($row = mysql_fetch_object ($result)) --that is what it was orginally but it is not pulling anything out of the db, which led me to echo the query results (see I am learning finally) so I could see if it really wasn't doing anything and well its not...and if I try to make an array and then fetch it as an object it tells me invalid, I think I'm confused about how to make an object out of an array (if that is what I want to do) this is pulling images from a db. Thanks guys! Terion
Re: [PHP] Resource ID# 5 and Resource id #5 8561 errors....help
On Fri, Dec 12, 2008 at 16:54, Terion Miller webdev.ter...@gmail.com wrote: $query = SELECT * FROM importimages WHERE Category='Obits' ; $result = mysql_query ($query); $arr = mysql_fetch_row($result); $result2 = $arr[0]; echo ($result2); Try this to get yourself started: ?php $sql = SELECT * FROM `importimages` WHERE `Category` = 'Obits'; $result = mysql_query($sql) or die(Error in .__FILE__.:.__LINE__. - .mysql_error()); while($row = mysql_fetch_array($result)) { foreach($row as $k = $v) { echo stripslashes($k).: .stripslashes($v).br /\n; } } ? NOTE: You shouldn't need stripslashes(), but it's put there just for backwards-compatibility in case you're on an older (or poorly-configured) installation. -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Resource ID# 5 and Resource id #5 8561 errors....help
On Fri, Dec 12, 2008 at 4:02 PM, Daniel P. Brown daniel.br...@parasane.netwrote: On Fri, Dec 12, 2008 at 16:54, Terion Miller webdev.ter...@gmail.com wrote: $query = SELECT * FROM importimages WHERE Category='Obits' ; $result = mysql_query ($query); $arr = mysql_fetch_row($result); $result2 = $arr[0]; echo ($result2); Try this to get yourself started: ?php $sql = SELECT * FROM `importimages` WHERE `Category` = 'Obits'; $result = mysql_query($sql) or die(Error in .__FILE__.:.__LINE__. - .mysql_error()); while($row = mysql_fetch_array($result)) { foreach($row as $k = $v) { echo stripslashes($k).: .stripslashes($v).br /\n; } } ? NOTE: You shouldn't need stripslashes(), but it's put there just for backwards-compatibility in case you're on an older (or poorly-configured) installation. -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php Thanks Daniel that did get me further, am I now to build an object from the array, or take off one of the array to make an object, your snippet did grab the names of the images and print them to the page but then I get stuck where the page is trying to get the property of a non-object ..so I guess im asking is a possible to turn an array into an object? or in this case separate objects?
Re: [PHP] Resource ID# 5 and Resource id #5 8561 errors....help
On Fri, Dec 12, 2008 at 4:52 PM, Terion Miller webdev.ter...@gmail.comwrote: On Fri, Dec 12, 2008 at 4:02 PM, Daniel P. Brown daniel.br...@parasane.net wrote: On Fri, Dec 12, 2008 at 16:54, Terion Miller webdev.ter...@gmail.com wrote: $query = SELECT * FROM importimages WHERE Category='Obits' ; $result = mysql_query ($query); $arr = mysql_fetch_row($result); $result2 = $arr[0]; echo ($result2); Try this to get yourself started: ?php $sql = SELECT * FROM `importimages` WHERE `Category` = 'Obits'; $result = mysql_query($sql) or die(Error in .__FILE__.:.__LINE__.well I changed it to - .mysql_error()); while($row = mysql_fetch_array($result)) { foreach($row as $k = $v) { echo stripslashes($k).: .stripslashes($v).br /\n; } } ? NOTE: You shouldn't need stripslashes(), but it's put there just for backwards-compatibility in case you're on an older (or poorly-configured) installation. -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php Thanks Daniel that did get me further, am I now to build an object from the array, or take off one of the array to make an object, your snippet did grab the names of the images and print them to the page but then I get stuck where the page is trying to get the property of a non-object ..so I guess im asking is a possible to turn an array into an object? or in this case separate objects? Well I did some changes and I must be learning because although I have the same error I don't have new ones... so now the code is like this: $sql = SELECT * FROM `importimages` WHERE `Category` = 'Obits'; $result = mysql_query($sql) or die(Error in .__FILE__.:.__LINE__. - .mysql_error()); while($object = mysql_fetch_object($result)) { foreach($object as $k = $v) { echo stripslashes($k).: .stripslashes($v).br /\n; } } $FileName = $object-Image; ---This is the line that is telling me it is trying to get the properties of a non-object
Re: [PHP] Resource ID# 5 and Resource id #5 8561 errors....help
On Fri, Dec 12, 2008 at 18:03, Terion Miller webdev.ter...@gmail.com wrote: Well I did some changes and I must be learning because although I have the same error I don't have new ones... so now the code is like this: $sql = SELECT * FROM `importimages` WHERE `Category` = 'Obits'; $result = mysql_query($sql) or die(Error in .__FILE__.:.__LINE__. - .mysql_error()); while($object = mysql_fetch_object($result)) { foreach($object as $k = $v) { echo stripslashes($k).: .stripslashes($v).br /\n; } } $FileName = $object-Image; ---This is the line that is telling me it is trying to get the properties of a non-object That's because you're calling that as an object using OOP standards, where I gave you procedural code. To interface with my code, just call it as: ?php // other code here while($row = mysql_fetch_array($result)) { echo $row['Image'].br /\n; // If `Image` is the column name. } // code continues ? -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Resource ID# 5 and Resource id #5 8561 errors....help
On Fri, Dec 12, 2008 at 5:08 PM, Daniel P. Brown daniel.br...@parasane.netwrote: On Fri, Dec 12, 2008 at 18:03, Terion Miller webdev.ter...@gmail.com wrote: Well I did some changes and I must be learning because although I have the same error I don't have new ones... so now the code is like this: $sql = SELECT * FROM `importimages` WHERE `Category` = 'Obits'; $result = mysql_query($sql) or die(Error in .__FILE__.:.__LINE__. - .mysql_error()); while($object = mysql_fetch_object($result)) { foreach($object as $k = $v) { echo stripslashes($k).: .stripslashes($v).br /\n; } } $FileName = $object-Image; ---This is the line that is telling me it is trying to get the properties of a non-object That's because you're calling that as an object using OOP standards, where I gave you procedural code. To interface with my code, just call it as: ?php // other code here while($row = mysql_fetch_array($result)) { echo $row['Image'].br /\n; // If `Image` is the column name. } // code continues ? -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php Here is the full chunk: $sql = SELECT * FROM `importimages` WHERE `Category` = 'Obits'; $result = mysql_query($sql) or die(Error in .__FILE__.:.__LINE__. - .mysql_error()); while($object = mysql_fetch_object($result)) { foreach($object as $k = $v) { echo stripslashes($k).: .stripslashes($v).br /\n; } } $FilePath = output/WebImagesHiRes/; $BackupPath = output/WebImagesHiRes/backup/; $FileName = $object-Image; //because it is going to process an image doesnt that make it oop? $FileName = str_replace(/, , $FileName); $FileName = str_replace(.jpg, , $FileName); Well its late friday afternoon here, I'm ready to break away from my desk...maybe on monday I will be able to get it working (right now our obit pics in the online paper are not getting posted...oops) Thanks folks yawn LEts call it a weekend wt terion
Re: [PHP] Resource ID# 5 and Resource id #5 8561 errors....help
Terion Miller wrote: On Fri, Dec 12, 2008 at 5:08 PM, Daniel P. Brown daniel.br...@parasane.netwrote: On Fri, Dec 12, 2008 at 18:03, Terion Miller webdev.ter...@gmail.com wrote: Well I did some changes and I must be learning because although I have the same error I don't have new ones... so now the code is like this: $sql = SELECT * FROM `importimages` WHERE `Category` = 'Obits'; $result = mysql_query($sql) or die(Error in .__FILE__.:.__LINE__. - .mysql_error()); while($object = mysql_fetch_object($result)) { foreach($object as $k = $v) { echo stripslashes($k).: .stripslashes($v).br /\n; } } $FileName = $object-Image; ---This is the line that is telling me it is trying to get the properties of a non-object That's because you're calling that as an object using OOP standards, where I gave you procedural code. To interface with my code, just call it as: ?php // other code here while($row = mysql_fetch_array($result)) { echo $row['Image'].br /\n; // If `Image` is the column name. } // code continues ? -- /Daniel P. Brown http://www.parasane.net/ daniel.br...@parasane.net || danbr...@php.net 50% Off Hosting! http://www.pilotpig.net/specials.php Here is the full chunk: $sql = SELECT * FROM `importimages` WHERE `Category` = 'Obits'; $result = mysql_query($sql) or die(Error in .__FILE__.:.__LINE__. - .mysql_error()); while($object = mysql_fetch_object($result)) { foreach($object as $k = $v) { echo stripslashes($k).: .stripslashes($v).br /\n; } } $FilePath = output/WebImagesHiRes/; $BackupPath = output/WebImagesHiRes/backup/; $FileName = $object-Image; //because it is going to process an image doesnt that make it oop? $FileName = str_replace(/, , $FileName); $FileName = str_replace(.jpg, , $FileName); Well its late friday afternoon here, I'm ready to break away from my desk...maybe on monday I will be able to get it working (right now our obit pics in the online paper are not getting posted...oops) Thanks folks yawn LEts call it a weekend wt terion Try this ?php $FilePath = output/WebImagesHiRes/; $BackupPath = output/WebImagesHiRes/backup/; #setup query $sql = SELECT * FROM `importimages` WHERE `Category` = 'Obits'; #excute query and return results, if any $result = mysql_query($sql) or die(Error in .__FILE__.:.__LINE__. - .mysql_error()); # Loop through results, pulling each resulting row as an object while($object = mysql_fetch_object($result)) { # Grab the Image contents and work with it. $FileName = $object-Image; // Watch it, this is case-sensitive!!! $FileName = str_replace(/, , $FileName); $FileName = str_replace(.jpg, , $FileName); echo $FileName; ... Do the rest of what you place to do with each row ... } ? -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Instructions on compiling PHP 5.2.8 for Mac OS X Server 10.4.11
Since Marc Liyange hasn't updated his binary since 5.2.4, I've been looking for some instructions on building my own, specifically the latest 5.2.8 source for 10.4 Server. Google doesn't turn up anything for me. Anyone have a good link? ...Rene -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using a class inside of a class
On Fri, 2008-12-12 at 13:21 -0800, Richard Kurth wrote: Can I use another class inside of a function in a class this function process_queue below is inside of a class called class mailer I want to use the phpMailer class inside of this function so I can send email using smtp. Can this be done and is there any information out there on how to do this Should be simple enough. Make sure you've included the file that holds the phpMailer class (and any dependencies it may have) then just instantiate an instance of the class... or am I missing the oint of the question? Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using a class inside of a class
Robert Cummings wrote: On Fri, 2008-12-12 at 13:21 -0800, Richard Kurth wrote: Can I use another class inside of a function in a class this function process_queue below is inside of a class called class mailer I want to use the phpMailer class inside of this function so I can send email using smtp. Can this be done and is there any information out there on how to do this Should be simple enough. Make sure you've included the file that holds the phpMailer class (and any dependencies it may have) then just instantiate an instance of the class... or am I missing the oint of the question? Cheers, Rob. sounds right to me Rob.. function whatever() { $mailer = new PHPMailer(); $mailer-send( $this-email ); } pretty standard stuff (and the point of classes/objects i think? regards! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Instructions on compiling PHP 5.2.8 for Mac OS X Server 10.4.11
Rene Fournier wrote: Since Marc Liyange hasn't updated his binary since 5.2.4, I've been looking for some instructions on building my own, specifically the latest 5.2.8 source for 10.4 Server. Google doesn't turn up anything for me. Anyone have a good link? ...Rene http://www.hmug.org/pub/MacOS_X/BSD/Server/WWW/php/ maybe - not sure but hope it helps (linux/win guy) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php