Re: [PHP] Clarity needed
Hi gang: I need some fog removed. I have a problem where I have an unlimited number of tutors teaching an unlimited number of courses. When I call upon a tutor, I want to see all the courses they teach. In my old days, I would just set up a linked list of courses and attach it to the tutor (another linked list). As a tutor adds courses, I would just add the course to the end of the linked list. If the tutor deletes a course, then I would remove it from the list by changing a single pointer. If I needed a list of all the courses the tutor taught, I would just run down the linked list pulling them out as needed. But now I have to think in terms of records in a database. I'll eventually figure it out, but what are your suggestions/solutions? I understand that I can have one record set up for each tutor, and another record set up for each course, and then tie the two together by another record like an assignment. That way I can have as many assignments as I want tying courses to tutors. It that the way you guys would do it? Thanks, tedd There is a very good schema for doing thing like that in this pdf. Its main purpose is to explain join temporary, tables and transactions but you will find it useful because I think it is relevant with your case. http://dev.mysql.com/tech-resources/articles/mysql-db-design-ch5.pdf Why don't you give it a try. -- Thodoris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php rpm
On Wed, Feb 4, 2009 at 12:59 PM, Daniel Brown wrote: On Wed, Feb 4, 2009 at 09:46, wrote: Okay here is my question. Does anyone know of an RPM of php that is pre-compiled with all the extras like soap, mssql, freetds, etc... Afternoon, Rich, et al; On an RHEL 5.3 system, you should already have 'yum' installed with the repos ready to go by default, so just drop to a command line and, as root, type: yum install php-soap yum install php-mssql yum install php-pdo etc. If your 'yum' isn't working from the get-go, check http://rpmfind.net/ or http://pbone.net/ for the individual RPM's. -- daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Unadvertised dedicated server deals, too low to print - email me to find out! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I might be wrong, but I think the packages have the php version appended to the it. so php5-soap, for example. At least it's like that in Fedora. Well I think this is a practice that FreeBSD uses in its ports and IMHO it is a good one. I don't remember if fedora is truly doing that but if it does that is cool I will check with my laptop (the only piece of hardware that has fedora installed). -- Thodoris
Re: [PHP] require() causing strange characters ?
On Fri, Feb 06, 2009 at 06:34:41AM +0100, cr.vege...@gmail.com wrote: > Hi all, > > I have a script called "test.php": > > > and a script called "echo.php": > > > With IE and Firefox it shows: CtestD > but when I view the source, it seems to be: C??testD > > When debugging it, it seems that: > > "C???testD" has length 9 in stead of 6 > > pos1 has char=C ord=67 > > pos2 has char=??? ord=239 > > pos3 has char=??? ord=187 > > pos4 has char=??? ord=191 > > rest okay ... > > Any idea what's causing this and how to solve it ? I don't know about the odd characters. You might try include() instead of require() and see if the behavior changes. I've noticed that Apache tends to insert an unpredictable number of spaces in code when PHP is embedded in the HTML. My best guess is that Apache substitutes blanks for all the non-printing PHP code in the file. But that's just a guess. How exactly are you managing to obtain the page in such a way that you can test character codes and such? Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pausing PHP scripts
Ron Piggott wrote: Is there a way to pause a PHP script while it is executing? Ron http://www.php.net/manual/en/function.sleep.php -- With warm regards, Sudheer. S Business: http://binaryvibes.co.in, Tech stuff: http://techchorus.net, Personal: http://sudheer.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pausing PHP scripts
Is there a way to pause a PHP script while it is executing? Ron
[PHP] require() causing strange characters ?
Hi all, I have a script called "test.php": and a script called "echo.php": With IE and Firefox it shows: CtestD but when I view the source, it seems to be: C�testD When debugging it, it seems that: > "CtestD" has length 9 in stead of 6 > pos1has char=C ord=67 > pos2has char=� ord=239 > pos3has char=� ord=187 > pos4has char=� ord=191 > rest okay ... Any idea what's causing this and how to solve it ? TIA, Cor
Re: [PHP] cgi vs php
Thanx for your reply Thodoris i really new to this. i will follow your suggestions. and i admit tht my query was silly its b'zoz i know less . but wht the hell reply by the "Martin Zvarík". has he done all this in womb. MZ u also need to think before commenting such. On Thu, Feb 5, 2009 at 9:33 PM, Martin Zvarík wrote: > Thodoris napsal(a): > > >> Y >>> >>> In cgi i can use perl ,c etc >>> suppose i use perl >>> >>> now how efficiency differs? >>> How cgi written in perl and php is differ in working in context of web >>> service? >>> >>> other difference?. >>> >>> but their differ. >>> >>> On Thu, Feb 5, 2009 at 6:45 PM, Jay Blanchard >>> wrote: >>> >>> >>> [snip] can anybody tell me the benefits of php over cgi or vice versa? i need to compare both? [/snip] CGI is a gateway to be used by languages PHP is a language >>> >>> >>> >>> >>> >> >> First of all try not to top post this is what we usually do here. >> >> Well CGI is a standard protocol implemented by many programming languages. >> You may start googling to find about it but this is a start: >> >> http://en.wikipedia.org/wiki/Common_Gateway_Interface >> >> Both Perl and PHP can work with CGI but working with Perl-CGI is not >> something that we should discuss in this list since this is a *PHP* list. >> >> IMHO you should start reading some aspects of web development to make some >> things clear before start asking questions in the lsit. This will improve >> your understanding and it help us to make suggestions. >> >> > I admire your calmness. > Such a descriptive reply for someone who doesn't think before asking. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- vikas sharma
Re: [PHP] Question about version control.. sorta..
My two cents, It's not bad, but you need to be aware of collisions. We set it up with a folder for each developer and it contains the main application code. The upside is that we each have our own code base so we don't affect each other when cutting new code. The downside is that we can each have the same file checked out and be working on it. The trouble comes when one deb checks in the file, as occasionally it will duplicate some lines in the code. It can lead to some funky errors. Otherwise, the only other error is the dispatcher going down and not passing the updates in. This does affect all users as the queue gets backed up until the dispatcher is turned back on. Bastien Sent from my iPod On Feb 5, 2009, at 21:06, "TG" wrote: So, for my purposes.. after trying a handful of solutions.. open source and commercial.. I think I've decided that Reliable Software's "Code Co- op" is what's going to work best for me. My trial is almost up, so as soon as my next paycheck comes, I think I'll be purchasing the full version for $150. For me, it's totally worth it. It stores everything in a local database, but allows collaboration if that's what you're into. Via email for the $150 version, via LAN for the $200 version. It lets me add files by type, is easy to check out files. Anyway.. if anyone's looking for an easy Windows version control system, check it out. (no, I don't work for them, just passing along the recommendation since I'm digging this software) Thanks for all the input! -TG - Original Message - From: "TG" To: php-general@lists.php.net Date: Wed, 31 Dec 2008 11:40:23 -0500 Subject: [PHP] Question about version control.. sorta.. Ok.. so I know about CVS and SVN and unfortunately haven't had as much experience with them as I'd like. I've used them, but always in a really basic sense and always on systems that have already been set up. A friend recently mentioned GIT ( http://git.or.cz/ ) too. But here's my situation.. I deal with dozens of clients. I usually make a backup copy of their site (at least the files, not usually the DB) so I have the latest copy of the site to make changes to. Usually I'm the only one working on the site, but sometimes other people may make changes too. Not so often than we're conflicting with our changes, or if this is a known issue, we make sure to coordinate. What I'd ideally like to do is be able to use a CVS type system to keep incremental backups of the code. So instead of checking code out of CVS, changing it, then checking it back in... I'd like to just do a mass checkin of the whole site and have changes recorded and the ability to look at previous versions with DIFF and all that. And of course the ability to 'check out' a previous set of files by date or revision maybe. I assume you can do this with one of the major version control systems, but mostly what I see with how to use these systems involves checking code out then checking it back in. That's not really what I want to do. The other issue is that I run Windows. So if there's something nice and WinGUI, that'd be nice. Please no "you should be running linux" responses. I don't have anything against Linux or Mac, they're great systems. But I have my reasons for running Windows. Also, I realize this is semi-OT for a PHP list, but asking on a CVS list or a SVN list might not give me the more comprehensive/broad experience base I'm looking for. I'd like a semi-unbiased response. :) Thanks in advance! -TG -- 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: Zend Framework and IIS
See this blog entry: http://2bits.com/articles/high-php-execution-times-drupal-and-tuning-apc-includeonce-performance.html On Fri, Jan 30, 2009 at 12:49 PM, Robert Cummings wrote: > On Fri, 2009-01-30 at 15:42 -0500, Andrew Ballard wrote: >> On Fri, Jan 30, 2009 at 12:46 PM, Andrew Ballard wrote: >> > Is anyone running Zend Framework under IIS? If so, how do you have it >> > configured? (ISAPI versus FastCGI, etc.) Do you use any code >> > optimizers? >> > >> > The reason I ask is because we set it up on a couple servers where I >> > work and it is dreadfully slow. Just to render a basic page with no >> > data connection (the index of the tutorial project I downloaded from >> > the ZF site) takes nearly 5, sometimes nearly 10, seconds -- with >> > eAccelerator running! I've run a couple other small sites with ZF on >> > shared (Linux) hosting and had no problems with it. (I know, I know - >> > switch to Linux. Not an option right now.) Is ZF really just that slow >> > under IIS? >> > >> > Andrew >> > >> >> Well, perhaps we solved this. We had the ZF library in a network file >> path on the SAN instead of a local path. Once we moved it to a local >> disk, everything sped up considerably. I would have thought that once >> a script got cached in either eAccelerator or APC (we tried both) that >> the location would be irrelevant since the cache is local (either >> memory or local disk), but that seems not to be the case. >> >> At any rate, I'm just glad this is working now. > > That depends a lot on this setting: > >eaccelerator.check_mtime="1" > > 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about version control.. sorta..
I use GIT and Subversion. Subversion is still a bit hard to use (branching etc) and not distributed but that was before i knew about GIT :-P. You have a central repository that you need to commit to and it's still quite CVS like (which is really confusing and horrible). GIT is nice and fast and also works in a distributed environment. So, it's great when you are the only one working on it or even if you have developers that don't always have broadband and want to commit to the central repository (when they are connected). It also has a windows port that is reasonably easy to install. Check out the cygwin unix on windows port library. It's great when you want the best of both worlds. Git is a package that you can select in there. I use windows at work and cygwin for all the unix stuff i want to do in windows, like perl, bash etc. It's awesome! Spending $150 on this is not really worth it i think and using a database for version control seems a bit odd. They have a database internally anyway which is optimised for the purpose and stored as files. Databases store the data as files (on disk) as well and only have the benefit that some of the data is stored partially in memory (indeces etc) and speeds up data retrieval (and i believe writing it too)... So give GIT a go. It also has a windows shell extension called 'Git Extensions'. Although you might like the GUI stuff, i think it's a lot easier to fire up a console (cmd or bash) and write git init git add . git commit -a -m "your msg" >From then on, you just have to type: git commit -a -m "your msg" to make commits. There is lots of help for it on the web which you wont get with a proprietary solution. In general Open Source seems to have better support than closed source (simply because there are a lot more people who are willing to help because they want to and not because they get paid). You can create a central repository relatively easy too and push/pull your commits to your local repository ( http://toolmantim.com/articles/setting_up_a_new_remote_git_repository ). You can also use one of the many repositories out there if you don't want to take care of backups etc. BTW, what do you need incremental backups for in a versioning system? A versioning system is an incremental backup (an advanced one)! You might want to backup the whole repository to a different location but you can safely overwrite that. I think Linus Torwalds did a really good job on that :-). Hail Linus (lol). It's versioning as easy as it can get. Hope this helps someone. Regards, Tim Tim-Hinnerk Heuer http://www.ihostnz.com On Fri, Feb 6, 2009 at 3:06 PM, TG wrote: > So, for my purposes.. after trying a handful of solutions.. open source and > commercial.. I think I've decided that Reliable Software's "Code Co-op" > is what's going to work best for me. > > My trial is almost up, so as soon as my next paycheck comes, I think I'll > be purchasing the full version for $150. > > For me, it's totally worth it. It stores everything in a local database, > but allows collaboration if that's what you're into. Via email for the > $150 version, via LAN for the $200 version. > > It lets me add files by type, is easy to check out files. Anyway.. if > anyone's looking for an easy Windows version control system, check it out. > > (no, I don't work for them, just passing along the recommendation since I'm > digging this software) > > Thanks for all the input! > > -TG > > - Original Message - > From: "TG" > To: php-general@lists.php.net > Date: Wed, 31 Dec 2008 11:40:23 -0500 > Subject: [PHP] Question about version control.. sorta.. > > > Ok.. so I know about CVS and SVN and unfortunately haven't had as much > > experience with them as I'd like. I've used them, but always in a really > > basic sense and always on systems that have already been set up. A > friend > > recently mentioned GIT ( http://git.or.cz/ ) too. > > > > But here's my situation.. I deal with dozens of clients. I usually make > a > > backup copy of their site (at least the files, not usually the DB) so I > > have the latest copy of the site to make changes to. Usually I'm the > only > > one working on the site, but sometimes other people may make changes too. > > > Not so often than we're conflicting with our changes, or if this is a > known > > issue, we make sure to coordinate. > > > > What I'd ideally like to do is be able to use a CVS type system to keep > > incremental backups of the code. So instead of checking code out of CVS, > > changing it, then checking it back in... I'd like to just do a mass > checkin > > of the whole site and have changes recorded and the ability to look at > > previous versions with DIFF and all that. And of course the ability to > > 'check out' a previous set of files by date or revision maybe. > > > > > > I assume you can do this with one of the major version control systems, > but > > mostly what I see with how to use these systems involves checking code > out > > t
Re: [PHP] Question about version control.. sorta..
So, for my purposes.. after trying a handful of solutions.. open source and commercial.. I think I've decided that Reliable Software's "Code Co-op" is what's going to work best for me. My trial is almost up, so as soon as my next paycheck comes, I think I'll be purchasing the full version for $150. For me, it's totally worth it. It stores everything in a local database, but allows collaboration if that's what you're into. Via email for the $150 version, via LAN for the $200 version. It lets me add files by type, is easy to check out files. Anyway.. if anyone's looking for an easy Windows version control system, check it out. (no, I don't work for them, just passing along the recommendation since I'm digging this software) Thanks for all the input! -TG - Original Message - From: "TG" To: php-general@lists.php.net Date: Wed, 31 Dec 2008 11:40:23 -0500 Subject: [PHP] Question about version control.. sorta.. > Ok.. so I know about CVS and SVN and unfortunately haven't had as much > experience with them as I'd like. I've used them, but always in a really > basic sense and always on systems that have already been set up. A friend > recently mentioned GIT ( http://git.or.cz/ ) too. > > But here's my situation.. I deal with dozens of clients. I usually make a > backup copy of their site (at least the files, not usually the DB) so I > have the latest copy of the site to make changes to. Usually I'm the only > one working on the site, but sometimes other people may make changes too. > Not so often than we're conflicting with our changes, or if this is a known > issue, we make sure to coordinate. > > What I'd ideally like to do is be able to use a CVS type system to keep > incremental backups of the code. So instead of checking code out of CVS, > changing it, then checking it back in... I'd like to just do a mass checkin > of the whole site and have changes recorded and the ability to look at > previous versions with DIFF and all that. And of course the ability to > 'check out' a previous set of files by date or revision maybe. > > > I assume you can do this with one of the major version control systems, but > mostly what I see with how to use these systems involves checking code out > then checking it back in. That's not really what I want to do. > > The other issue is that I run Windows. So if there's something nice and > WinGUI, that'd be nice. Please no "you should be running linux" > responses. I don't have anything against Linux or Mac, they're great > systems. But I have my reasons for running Windows. > > Also, I realize this is semi-OT for a PHP list, but asking on a CVS list or a > SVN list might not give me the more comprehensive/broad experience base I'm > looking for. I'd like a semi-unbiased response. :) > > Thanks in advance! > > -TG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I use a function's default arguments but change one of the end ones in the list?
On Thu, Feb 5, 2009 at 20:10, German Geek wrote: > I've thought about this problem before but couldn't think of a solution > either. How does func_get_args() solve this? You could make a wrapper > function without that. It's all in how it's used. Ironically, I don't remember saying that you couldn't make a wrapper function without it, or that it was required to make a wrapper. Thanks for clarifying that for everyone just in case. ;-P > How would u (php) know which parameter u mean in a particular case? You don't have to. You can send NULL or empty strings for that matter, and use the parameter position in func_get_args() that way. Or using hierarchy and preference: Though inelegant, it works. What would probably be better, though, would be to write the wrapper as I mentioned, but have it accept a single parameter as an array, like so: $v) { $$k = $v; } // Call original function with these values and pass through the results. return orig_func($param_one,$param_two,$param_three,$param_four); } // Then use it like so: $params = array( 'param_two' => 'Orange', 'param_four' => 543.21, ); ?> If all orig_func() did was a simple foreach()/echo routine, it wrapper_func() would print: [NULL] Orange foo 543.21 > I think it would just be useful to have an IDE that can write out the > default parameters on a keyboard shortcut or mouse click and then u can > change them afterwards. It would be nice if every programmer touching the code had the same IDE. Unfortunately, it's just not practical. -- daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Unadvertised dedicated server deals, too low to print - email me to find out! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I use a function's default arguments but change one of the end ones in the list?
German Geek wrote: > I've thought about this problem before but couldn't think of a solution > either. How does func_get_args() solve this? You could make a wrapper > function without that. > > How would u (php) know which parameter u mean in a particular case? > > I think it would just be useful to have an IDE that can write out the > default parameters on a keyboard shortcut or mouse click and then u can > change them afterwards. > > Cheers, > Tim > > Tim-Hinnerk Heuer > > http://www.ihostnz.com > Well, using func_get_args() you can pass whatever you want and parse the args to see what was passed and assign default values if a specific arg wasn't passed. I however would probably pass an associative array to the func and parse that. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I use a function's default arguments but change one of the end ones in the list?
Daevid Vincent wrote: > Is there a way to use the default values of a function without > specifying every single one until the parameter you want to modify in > PHP5 ? > > I don't see it here, but feel this would be very useful indeed. > http://www.php.net/manual/en/functions.arguments.php > > So given a function that takes seven parameters, I want to change one of > them and leave the other defaults alone... > > The above function call doesn't error out on me, it just seems it > doesn't do anything either :-\ > > So it seems I have to do this verboseness (AND know what the default > values are to begin with too): > > SQL_QUERY('SELECT * FROM foo WHERE bar = ?', array('beep'), false, true, > false, false); > > Just to change one default parameter?!? :-( > What you are wanting to do is not possible. Back in the day, I worked on a project that used our own variation of this type of functionality. We had this function that helped a little function alternate(&$a, $b) { return $a = ( $a ? $a : $b ); } function query($sql, $params=array()) { alternate($params, array()); extract($params); alternate($parameters, null); alternate($showSQL, false); alternate($showErrors, true); alternate($execute, true); alternate($noHTML, false); alternate($profile, 0); # Do your thing... } This allowed for us to include/exclude whatever we wanted from the it is a little long winded to get to what you are looking for ( I think ) But it worked for us. -- 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
Re: [PHP] How can I use a function's default arguments but change one of the end ones in the list?
I've thought about this problem before but couldn't think of a solution either. How does func_get_args() solve this? You could make a wrapper function without that. How would u (php) know which parameter u mean in a particular case? I think it would just be useful to have an IDE that can write out the default parameters on a keyboard shortcut or mouse click and then u can change them afterwards. Cheers, Tim Tim-Hinnerk Heuer http://www.ihostnz.com On Fri, Feb 6, 2009 at 1:56 PM, Daniel Brown wrote: > On Thu, Feb 5, 2009 at 18:50, Daevid Vincent wrote: > > Is there a way to use the default values of a function without > > specifying every single one until the parameter you want to modify in > > PHP5 ? > > Daevid, > >Check out func_get_args(): http://php.net/func_get_args > >Then you can rename your sql_query() function to real_sql_query() > and create a new sql_query() as a wrapper function with > func_get_args() in place of statically-defined variables. > > -- > > daniel.br...@parasane.net || danbr...@php.net > http://www.parasane.net/ || http://www.pilotpig.net/ > Unadvertised dedicated server deals, too low to print - email me to find > out! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] CLI not obeying php.ini
Philip Thompson wrote: > In my php.ini, I have > > error_reporting = E_ALL & ~E_NOTICE > > When I run a script from the command line, I get a lot of notices > even when I said I don't want them. Also, in my script, I specified > error_reporting(E_ERROR) in attempts to explicitly tell it what I > want. It doesn't work either. > > Why am I still getting notices?! BTW, I don't receive notices via a > web browser, just CLI. > > I double-checked to see what INI file was loaded and it's the one I > expected to see: > > [pthomp...@pthompson scripts]$ php --ini > Configuration File (php.ini) Path: /etc > Loaded Configuration File: /etc/php.ini > > Thoughts on what's happening would be awesome! Thanks in advance. > > ~Philip > Run this to find out which ini file is being parsed: php -i | grep ini Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preserving History
Dan Shirah schreef: >> Hi gang: >> >> To further the Garbage Collection thread on to another level (i.e., >> preserving history) please consider this: >> >> Okay, let's say we have a table containing all the instances of tutors >> teaching courses. A record might look like this: >> >> Course-to-Tutor table >> course_id = 123 >> tutor_id = 7 >> date_active = 2/4/9 >> date_inactive = null >> >> The above record was assembled from the following recrods: >> >> Tutor table: >> id = 7 >> name = joe >> >> Course table: >> id = 123 >> title = Introduction to Moonshine >> >> Okay, so let's now delete the course "Introduction to Moonshine"! >> >> At the first opportunity to search the Course-to-Tutor table we find that >> the course 123 is now absent from our database and as such we set the >> date_inactive field -- it won't be considered again. >> >> Okay, so what does that tell us about the history? It only provides that at >> one time joe taught an undefined course. Furthermore, if joe quits, then we >> only have a record that says someone with an id of 7 taught a course with an >> id of 123 -- that doesn't make much sense, does it? >> >> Now, if we reconsider the Course-to-Tutor table and instead of putting in >> the tutor_id and course_id, we put in the actual name of the tutor and title >> of the class, then at least we have a history that makes sense. >> >> However by doing that, we violate the primary principle of a relational >> database by creating redundant data. >> >> I guess that one can say that if we never actually delete the tutor nor the >> course, but instead just make them inactive as well, then we have solved the >> problem -- is that the answer? >> >> In any event, what problems do you foresee if I used the actual names and >> titles for the Course-to-Tutor table instead of their id's? After all, the >> instance records would retain a simple history of what happened regardless >> of deletions AND a search for "Introduction to Moonshine" should be >> essentially as fast as a search for "123" if both fields are indexed, am I >> right or wrong? >> >> Cheers, >> >> tedd >> > You only need to use ONE value in both tables. > > tutor_table: > > tutor_id = 7 > first_name = joe > last_name = smith > active_tutor = Y > > course_table: > > course_id = 123 > tutor_id = 7 > title = Introduction to Moonshine > active_course = Y > > A crude query to return all active tutors and their courses would be: > > SELECT tutor_table.first_name, tutor_table.last_name, course_table.title > FROM tutor_table, course_table > WHERE tutor_table.tutor_id = course_table.tutor_id > AND tutor_table.active_tutor = 'Y' > AND course_table.active_course = 'Y' I would use a more generic field that 'active_tutor', et al something like 'state' ... and make it an ENUM field with some values which you could later extend, e.g. active deceased incapacitated inactive fired a different set of states could be defined for courses: active inactive deleted you might also consider some kind of transaction table to store state changes ... or defer to Nate Rixham about using geospatial indexes (storing id+timestamp as primary key ... thereby creating a new record for each change in the data) @Nathan ... sorry if I spelt your name wrong, it's late and a bottle of wine has been emptied. > > That will return the course title and tutor name for all active events > > Hope that helps. > Dan > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Clarity needed
Jochem Maas wrote: > Daniel Brown schreef: >> On Thu, Feb 5, 2009 at 07:56, Jochem Maas wrote: >>> and the answer to you Q, like everyone else said: yup :-) >>> >>> PS - given you unlimited resources you might consider doing a >>> charitable donation to FoxNews aficionados :-) >> Or reminding you how to speak English, Jochem. What the hell are >> you trying to say here?!? ;-P > > that tedd's unlimited educational resources (tutors/courses) might > go someway to undoing all the harm Fox News inflicts on the masses. > >> Man, a guy disappears for a while and his speech goes to gibberish >> almost as bad as my own. ;-P > > almost :-P > > Or fox may go someway towards dulling the socialist propaganda of the tutors/courses. We're headed there, but thank God I'm not schreefing from an insanely socialist country! :-) -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I use a function's default arguments but change one of the end ones in the list?
On Thu, Feb 5, 2009 at 18:50, Daevid Vincent wrote: > Is there a way to use the default values of a function without > specifying every single one until the parameter you want to modify in > PHP5 ? Daevid, Check out func_get_args(): http://php.net/func_get_args Then you can rename your sql_query() function to real_sql_query() and create a new sql_query() as a wrapper function with func_get_args() in place of statically-defined variables. -- daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Unadvertised dedicated server deals, too low to print - email me to find out! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Clarity needed
Daniel Brown schreef: > On Thu, Feb 5, 2009 at 07:56, Jochem Maas wrote: >> and the answer to you Q, like everyone else said: yup :-) >> >> PS - given you unlimited resources you might consider doing a >> charitable donation to FoxNews aficionados :-) > > Or reminding you how to speak English, Jochem. What the hell are > you trying to say here?!? ;-P that tedd's unlimited educational resources (tutors/courses) might go someway to undoing all the harm Fox News inflicts on the masses. > > Man, a guy disappears for a while and his speech goes to gibberish > almost as bad as my own. ;-P almost :-P > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Email configuration
Thanks guys, I'm gonna read all this staff, and let you know if have some issues. Thanks a lot --- On Thu, 2/5/09, Yannick Mortier wrote: > From: Yannick Mortier > Subject: Re: [PHP] Email configuration > To: t...@kinetix.gr > Cc: itmaqu...@yahoo.com, php-general@lists.php.net > Date: Thursday, February 5, 2009, 3:19 PM > 2009/2/5 Thodoris : > > > > I think that the OP mentioned the word fedora > somewhere above... > > > > Oh sorry, I'm so stupid... Anyways, if you want to send > mail to large > providers you'll need to use a relay. I found a nice > tutorial about > how to set it up with google apps. > It was for Ubuntu but you just have to install msmtp and > follow the other steps. > Here it is: > http://nanotux.com/blog/the-ultimate-server/4/#l-mail > I did it on my little gentoo server here at home and it > works great. > > > > -- > Currently developing a browsergame... > http://www.p-game.de > Trade - Expand - Fight > > Follow me at twitter! > http://twitter.com/moortier > > -- > 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] How can I use a function's default arguments but change one of the end ones in the list?
Is there a way to use the default values of a function without specifying every single one until the parameter you want to modify in PHP5 ? I don't see it here, but feel this would be very useful indeed. http://www.php.net/manual/en/functions.arguments.php So given a function that takes seven parameters, I want to change one of them and leave the other defaults alone... outputs: --- string(31) "SELECT * FROM foo WHERE bar = ?" NULL bool(false) bool(true) bool(true) bool(false) int(0) --- string(31) "SELECT * FROM foo WHERE bar = ?" array(1) { [0]=> string(4) "beep" } bool(true) bool(true) bool(true) bool(false) int(0) --- string(31) "SELECT * FROM foo WHERE bar = ?" array(1) { [0]=> string(4) "beep" } bool(false) bool(true) bool(true) <-- I would have expected this one to be bool(false) bool(false) int(0) The above function call doesn't error out on me, it just seems it doesn't do anything either :-\ So it seems I have to do this verboseness (AND know what the default values are to begin with too): SQL_QUERY('SELECT * FROM foo WHERE bar = ?', array('beep'), false, true, false, false); Just to change one default parameter?!? :-(
Re: [PHP] Re: DB Comparisons
Asp(.net) has no real problems connecting to mysql. But it's slower than php. Bastien Sent from my iPod On Feb 5, 2009, at 16:39, Ashley Sheridan wrote: On Thu, 2009-02-05 at 16:19 -0500, Robert Cummings wrote: On Thu, 2009-02-05 at 21:03 +, Nathan Rixham wrote: revDAVE wrote: Hi Folks, I¹m curious if there are any previous discussions / Articles / URL¹s that compare the power and scalability of MySQL (with php) with other technologies like MS sequel server oracle - coldfusion etc I imagine that most middleware like php / asp / coldfusion is relatively good & fast - (let me know if one is better ). Mostly I¹m con cerned with the speed and power of the backend database as to how it functions on an enterprise scale such as how many hits it can handle per hour how many users before it starts to slow down etc. honestly, if you're thinking enterprise scale then database is the least of you're worries, you'll be needing to move away from a scripting language and go for a pre compiled programming language. Isn't Yahoo using PHP? I thought Facebook too? Doesn't seem like they moved away from a scripting language. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP As far as DB's are concerned, this is my experience: SQLLite is blindingly fast, but limited in functionality. For most small needs its fine though, and it is free. MySQL is fully powered and very fast, faster than MSSQL and Oracle, and it's free. Oracle is the slowest, but has a lot of features in to safeguard data against accidents, so is the best for critical apps where data loss would be a major issue. As far as I know it's also the most expensive. MSSQL is slow, and you need the latest versions to get the features you need (I'm stuck at work writing work-arounds for apps because they don't want to buy the latest versions!) SQLLite, MySQL and Oracle are all cross-platform, and MSSQL is Windows only. The major languages have modules that let you connect to all of the databases, although I think ASP can only connect to MSSQL and ASP.Net connects only to MSSQL and Oracle (but I'm not 100% certain on this) Also, as far as I'm aware, there are no drawbacks to mixing and matching the various DB's with the various languages. Ash www.ashleysheridan.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
Re: [PHP] German characters Ö,Ä etc. show up as ?
On Thu, Feb 5, 2009 at 7:37 AM, Merlin Morgenstern wrote: > Hi there, > > I recently upgraded on my prod system from php 4.x to the newest php > version. Now german characters lik "Ö" show up as ?. I have the same setup > running on a test server, where the characters show up OK. After searching > on Google I found that there is an entry in the php.ini: > default_charset = "iso-8859-1" which could help me, however this is not set > in the test environment! How come? Is there another way to fix this? > > Kind regards,Merlin > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > header('Content-Type: text/html; charset=utf-8'); You might want to get with the current century and consider utf8! :D I'll leave you to your own devices on regressing that. -- http://www.voom.me | EFnet: #voom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] German characters Ö,Ä etc. show up as ?
On Fri, 2009-02-06 at 12:23 +1300, German Geek wrote: > Do they show up as ? just in the web page or in the source returned? Did you > check the source of the page? I had this problem before and as far as i > remember, i just needed to encode them like oe (have an american keyboard > ;-) ö etc. If it's a literal ? in the source, it's PHP and you might > need to set your php.ini in some way to support your character set. Have a > look into Unicode as well. I haven't had this problem for a while since i > don't live in Germany anymore, but i'm sure i will probably come across this > some day ;-). > > Good luck! > > Regards, > Tim > > Tim-Hinnerk Heuer > > http://www.ihostnz.com > > > On Fri, Feb 6, 2009 at 1:37 AM, Merlin Morgenstern > wrote: > > > Hi there, > > > > I recently upgraded on my prod system from php 4.x to the newest php > > version. Now german characters lik "Ö" show up as ?. I have the same setup > > running on a test server, where the characters show up OK. After searching > > on Google I found that there is an entry in the php.ini: > > default_charset = "iso-8859-1" which could help me, however this is not set > > in the test environment! How come? Is there another way to fix this? > > > > Kind regards,Merlin > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > If the source has been saved with literal ? characters, then you may need to add them all over again. I'm assuming though that the source is fine, as it's working on your test server. Have you tried altering the character encoding through a meta tag? I had this issue where it was showing ? characters until I changed the meta tag to utf-8. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] German characters Ö,Ä etc. show up as ?
Do they show up as ? just in the web page or in the source returned? Did you check the source of the page? I had this problem before and as far as i remember, i just needed to encode them like oe (have an american keyboard ;-) ö etc. If it's a literal ? in the source, it's PHP and you might need to set your php.ini in some way to support your character set. Have a look into Unicode as well. I haven't had this problem for a while since i don't live in Germany anymore, but i'm sure i will probably come across this some day ;-). Good luck! Regards, Tim Tim-Hinnerk Heuer http://www.ihostnz.com On Fri, Feb 6, 2009 at 1:37 AM, Merlin Morgenstern wrote: > Hi there, > > I recently upgraded on my prod system from php 4.x to the newest php > version. Now german characters lik "Ö" show up as ?. I have the same setup > running on a test server, where the characters show up OK. After searching > on Google I found that there is an entry in the php.ini: > default_charset = "iso-8859-1" which could help me, however this is not set > in the test environment! How come? Is there another way to fix this? > > Kind regards,Merlin > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] function_exists question
How about this PHP developers: You could make a global variable (or constant) the user can set like define('PHP_COMPATIBLE_VERSION', '5.0.1'); or something to tell PHP 6 to interpret it like PHP 5.x . That way, at least you are guaranteed that the code will work like on that version. It might make PHP 6 (a lot?) bigger but it might be worth the cost, since all Sites written in PHP will still work. The functions could still have a performance boost that way if there are better algorithms. php5 introduced this: http://au.php.net/manual/en/ini.core.php#ini.zend.ze1-compatibility-mode to make sure php5 interpreted php4 code in a b/c way, they may do something similar for php6 -> php5. Doing it at runtime is silly imo. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] function_exists question
> -Original Message- > From: th.he...@gmail.com [mailto:th.he...@gmail.com] On Behalf Of > German Geek > Sent: Thursday, February 05, 2009 5:02 PM > To: t...@kinetix.gr > Cc: Matt Pagel; php-general@lists.php.net > Subject: Re: [PHP] function_exists question > > Why can't you update to Version 5? I might be a bit anal about trying > to > always get the newest version of everything, but seriously version 3 > has > surely more known security issues as well as performance costs. > > What's the cost of upgrading compared to the cost of writing code that > works > in every version? I think upgrading the system to PHP 5 will take you > maybe > half an hour, while you can spend a lot more hours on writing backward > compatible code. PHP is not very good with compatibility across > versions > anyway. Hopefully all PHP 5 code will work in PHP 6. > > How about this PHP developers: You could make a global variable (or > constant) the user can set like > > define('PHP_COMPATIBLE_VERSION', '5.0.1'); > > or something to tell PHP 6 to interpret it like PHP 5.x . That way, at > least > you are guaranteed that the code will work like on that version. It > might > make PHP 6 (a lot?) bigger but it might be worth the cost, since all > Sites > written in PHP will still work. The functions could still have a > performance > boost that way if there are better algorithms. > > Sorry for steeling the thread. > > Regards, > Tim > > Tim-Hinnerk Heuer > > http://www.ihostnz.com > > > On Fri, Feb 6, 2009 at 12:55 AM, Thodoris wrote: > > > > > Is there a way to check not only if a function exists, but also to > check > >> that the number and types of parameters desired match a function > definition? > >> > >> The reason being that additional options have been added in php 4 > and 5 to > >> various standard function calls, but I'm still running a php3 and > php4 > >> server in addition to a php5 server. I would like to make sure that > certain > >> "extended" function calls still work in all versions (or I'll > perform the > >> tasks "manually", albeit less efficiently). > >> > >> One example I can think of is the round() function. The $precision > >> parameter was added in php4, so will not work in php3. However, > >> function_exists would return TRUE for both 3 and 4, but round itself > would > >> fail if I tried to send a precision level to the php3 server. > >> > >> Thanks much, > >> Matt > >> > >> P.S. Of course the modified "function_exists" would unfortunately > have to > >> be a recognized function/method in php3 in order for me to call it > to check > >> parameter counts on a php3 server :( > >> > >> > > I am sure you have some good reasons for keeping php3 right? > > > > Why don't you consider updating to at least php4 ?? > > > > PHPv3 is not even maintained and PHPv4 is not being developed any > more. > > > > So by the end of this year (I hope) we will start using a stable > PHPv6. > > > > IMHO you should consider changing your code (if this is possible) to > a more > > mainstream version. I think it would be much easier to run several versions of PHP in tandem on the same server, and let an .htaccess file (or some other such convention) determine the version of PHP to run particular files/directories/etc. with. My 2c, // Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] function_exists question
Why can't you update to Version 5? I might be a bit anal about trying to always get the newest version of everything, but seriously version 3 has surely more known security issues as well as performance costs. What's the cost of upgrading compared to the cost of writing code that works in every version? I think upgrading the system to PHP 5 will take you maybe half an hour, while you can spend a lot more hours on writing backward compatible code. PHP is not very good with compatibility across versions anyway. Hopefully all PHP 5 code will work in PHP 6. How about this PHP developers: You could make a global variable (or constant) the user can set like define('PHP_COMPATIBLE_VERSION', '5.0.1'); or something to tell PHP 6 to interpret it like PHP 5.x . That way, at least you are guaranteed that the code will work like on that version. It might make PHP 6 (a lot?) bigger but it might be worth the cost, since all Sites written in PHP will still work. The functions could still have a performance boost that way if there are better algorithms. Sorry for steeling the thread. Regards, Tim Tim-Hinnerk Heuer http://www.ihostnz.com On Fri, Feb 6, 2009 at 12:55 AM, Thodoris wrote: > > Is there a way to check not only if a function exists, but also to check >> that the number and types of parameters desired match a function definition? >> >> The reason being that additional options have been added in php 4 and 5 to >> various standard function calls, but I'm still running a php3 and php4 >> server in addition to a php5 server. I would like to make sure that certain >> "extended" function calls still work in all versions (or I'll perform the >> tasks "manually", albeit less efficiently). >> >> One example I can think of is the round() function. The $precision >> parameter was added in php4, so will not work in php3. However, >> function_exists would return TRUE for both 3 and 4, but round itself would >> fail if I tried to send a precision level to the php3 server. >> >> Thanks much, >> Matt >> >> P.S. Of course the modified "function_exists" would unfortunately have to >> be a recognized function/method in php3 in order for me to call it to check >> parameter counts on a php3 server :( >> >> > I am sure you have some good reasons for keeping php3 right? > > Why don't you consider updating to at least php4 ?? > > PHPv3 is not even maintained and PHPv4 is not being developed any more. > > So by the end of this year (I hope) we will start using a stable PHPv6. > > IMHO you should consider changing your code (if this is possible) to a more > mainstream version. > > -- > Thodoris > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Sometime the code works and sometimes doesn't
I would also suggest that you hash the passwords at least (better even with a salt value) and then reset the password to something random before sending it to the user. Email can be sniffed relatively easily and this would expose a possible carefully chosen password by the user and then they have to think of something new which they probably forget (although, they probably forgot the password in the first case :-). Maybe there is a possibility that you have 2 or more user records with the same email address? because then the result count would not be 1. Cheers, Tim Tim-Hinnerk Heuer http://www.ihostnz.com On Sat, Jan 17, 2009 at 5:21 AM, Chris Carter wrote: > > Hi, > > Here is a code for PHP password sending. There is some strange thing > happening. This code DOES WORK but not always. So I might be able to get > the > password in my mailbox once but not always. What could be wrong. > >// database information > $host = 'xxx'; > $user = 'xxx'; > $password = 'xxx'; > $dbName = 'xxx'; > > // connect and select the database >$conn = mysql_connect($host, $user, $password) or > die(mysql_error()); >$db = mysql_select_db($dbName, $conn) or die(mysql_error()); > > // value sent from form > $emailAddress=$_POST['emailAddress']; > > $sql="SELECT password FROM mytable WHERE emailAddress='$emailAddress'"; > $result=mysql_query($sql); > > // keep value in variable name "$count" > $count=mysql_num_rows($result); > > // compare if $count =1 row > if($count==1){ > > $rows=mysql_fetch_array($result); > > // keep password in $your_password > $your_password=$rows['password']; > > $subject="Your password is retrieved"; > > $header="from: Great Site"; > > $messages= "Hi \n\n Your password for login to our website is > retrieved.\n\n"; > $messages.="Your password is '$your_password' \n\n"; > $messages.="You can use this password"; > > // send email > $sentmail = mail($emailAddress, $subject, $messages, $header); > } > // else if $count not equal 1 > else { > echo "Not found your email in our database"; > } > > // if your email succesfully sent > if($sentmail){ > echo "Your Password Has Been Sent To Your Email Address."; > } > else { > echo "Cannot send password to your e-mail address"; > } > ?> > > There must be something that I am doing wrong. Otherwise I could have > always > gotten the password in my mailbox. Please help. > > Thanks in advance, > > Chris > -- > View this message in context: > http://www.nabble.com/Sometime-the-code-works-and-sometimes-doesn%27t-tp21502951p21502951.html > Sent from the PHP - General mailing list archive at Nabble.com. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] CLI not obeying php.ini
On Feb 5, 2009, at 4:20 PM, Boyd, Todd M. wrote: -Original Message- From: Philip Thompson [mailto:philthath...@gmail.com] Sent: Thursday, February 05, 2009 3:45 PM To: PHP General list Subject: [PHP] CLI not obeying php.ini In my php.ini, I have error_reporting = E_ALL & ~E_NOTICE When I run a script from the command line, I get a lot of notices even when I said I don't want them. Also, in my script, I specified error_reporting(E_ERROR) in attempts to explicitly tell it what I want. It doesn't work either. Why am I still getting notices?! BTW, I don't receive notices via a web browser, just CLI. I double-checked to see what INI file was loaded and it's the one I expected to see: [pthomp...@pthompson scripts]$ php --ini Configuration File (php.ini) Path: /etc Loaded Configuration File: /etc/php.ini Thoughts on what's happening would be awesome! Thanks in advance. In addition to what's already been said, you could try forcing a php.ini file in the current directory by trying the -c command line option. I've done it to try messing with a handful of values here and there for particular scripts. HTH, // Todd I tried this as well. No luck. [pthomp...@pthompson scripts]$ php -c /etc -f updateLabels.php > labels.log This issue is mainly annoying and not really a bigger issue b/c clients don't see it. Hrm. Oh well. Still open to suggestions. Should I try kicking my (virtual) machine? =D ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preserving History
On Thu, Feb 05, 2009 at 04:38:25PM -0500, tedd wrote: > Hi gang: > > To further the Garbage Collection thread on to another level (i.e., > preserving history) please consider this: > > Okay, let's say we have a table containing all the instances of > tutors teaching courses. A record might look like this: > > Course-to-Tutor table > course_id = 123 > tutor_id = 7 > date_active = 2/4/9 > date_inactive = null > > The above record was assembled from the following recrods: > > Tutor table: > id = 7 > name = joe > > Course table: > id = 123 > title = Introduction to Moonshine > > Okay, so let's now delete the course "Introduction to Moonshine"! > > At the first opportunity to search the Course-to-Tutor table we find > that the course 123 is now absent from our database and as such we > set the date_inactive field -- it won't be considered again. > > Okay, so what does that tell us about the history? It only provides > that at one time joe taught an undefined course. Furthermore, if joe > quits, then we only have a record that says someone with an id of 7 > taught a course with an id of 123 -- that doesn't make much sense, > does it? No. If you're concerned about history, leave the course and tutor records in place. Simply change record in the "Course-to-Tutor" table. Set the date_inactive field to today's date or whatever. If you're concerned about history, you never delete the records that contribute to a link table. You can delete the record that binds them together in the link table, but not if you want to preserve history. > > Now, if we reconsider the Course-to-Tutor table and instead of > putting in the tutor_id and course_id, we put in the actual name of > the tutor and title of the class, then at least we have a history > that makes sense. Don't do this. Your searches and indexes will take longer and it will complicate things. Maintain your primary keys as integers. If you want to know the name of the guy who taught course ID 123 from this date to that date, just issue a query which joins the tables. As long as your data is somewhere in these tables (in *one* place, please), you can join tables in a query and get any info you want. > > However by doing that, we violate the primary principle of a > relational database by creating redundant data. While this is true in the ideal world of Codd, in the real world, there is often some minor duplication of data. But in your case, it isn't needed. > > I guess that one can say that if we never actually delete the tutor > nor the course, but instead just make them inactive as well, then we > have solved the problem -- is that the answer? > > In any event, what problems do you foresee if I used the actual names > and titles for the Course-to-Tutor table instead of their id's? After > all, the instance records would retain a simple history of what > happened regardless of deletions AND a search for "Introduction to > Moonshine" should be essentially as fast as a search for "123" if > both fields are indexed, am I right or wrong? Not necessarily. In fact, if you add on to this schema, you'll ultimately find that IDs are vastly easier to manage. They make the queries more complex, but the tables are easier to manage. Trust me on this. I've had to go back and redesign tables where I used a long string like a name for the index, and it's generally a bad idea. I expect most DBAs and programmers will agree. Oh, here's another *excellent* reason not to use names: fat fingers. If someone misspells a name or a course title, you can change it to your heart's content if it's just a field in a table. But if it's a key that binds tables together, you can't change it without cascading problems. That key is now in *at least* two places and must be changed *everywhere*, and the DBMS normally won't let you do that. You could add "cascade update" provisions into your tables, but why? Just use an integer key, and you're away. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: DB Comparisons
On 2/5/2009 1:03 PM, "Nathan Rixham" wrote: Nathan - Thanks so much for your detailed info - much appreciated! On 2/5/2009 1:19 PM, "Robert Cummings" wrote: > Isn't Yahoo using PHP? I thought Facebook too? Doesn't seem like they > moved away from a scripting language. And BTW - it seems as though myspace.com still is using coldfusion. I wonder what the backend db is? -- Thanks - RevDave Cool @ hosting4days . com [db-lists 09] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CLI not obeying php.ini
On Feb 5, 2009, at 4:10 PM, Chris wrote: Philip Thompson wrote: In my php.ini, I have error_reporting = E_ALL & ~E_NOTICE When I run a script from the command line, I get a lot of notices even when I said I don't want them. Also, in my script, I specified error_reporting(E_ERROR) in attempts to explicitly tell it what I want. It doesn't work either. Why am I still getting notices?! BTW, I don't receive notices via a web browser, just CLI. I double-checked to see what INI file was loaded and it's the one I expected to see: [pthomp...@pthompson scripts]$ php --ini Configuration File (php.ini) Path: /etc Loaded Configuration File: /etc/php.ini Thoughts on what's happening would be awesome! Thanks in advance. Are you including another script (eg pear mail or mbd2 or whatever)? Maybe it's setting something and overriding your attempt. A quick grep would be able to check that. I am including other classes. I did a grep on the whole directory and the only location that had error_reporting was the spot I wrote into my script to force it to E_ERROR. Odd, I know... Thanks, ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] CLI not obeying php.ini
> -Original Message- > From: Philip Thompson [mailto:philthath...@gmail.com] > Sent: Thursday, February 05, 2009 3:45 PM > To: PHP General list > Subject: [PHP] CLI not obeying php.ini > > In my php.ini, I have > > error_reporting = E_ALL & ~E_NOTICE > > When I run a script from the command line, I get a lot of notices > even when I said I don't want them. Also, in my script, I specified > error_reporting(E_ERROR) in attempts to explicitly tell it what I > want. It doesn't work either. > > Why am I still getting notices?! BTW, I don't receive notices via a > web browser, just CLI. > > I double-checked to see what INI file was loaded and it's the one I > expected to see: > > [pthomp...@pthompson scripts]$ php --ini > Configuration File (php.ini) Path: /etc > Loaded Configuration File: /etc/php.ini > > Thoughts on what's happening would be awesome! Thanks in advance. In addition to what's already been said, you could try forcing a php.ini file in the current directory by trying the -c command line option. I've done it to try messing with a handful of values here and there for particular scripts. HTH, // Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CLI not obeying php.ini
On Feb 5, 2009, at 4:17 PM, Ashley Sheridan wrote: On Thu, 2009-02-05 at 15:45 -0600, Philip Thompson wrote: In my php.ini, I have error_reporting = E_ALL & ~E_NOTICE When I run a script from the command line, I get a lot of notices even when I said I don't want them. Also, in my script, I specified error_reporting(E_ERROR) in attempts to explicitly tell it what I want. It doesn't work either. Why am I still getting notices?! BTW, I don't receive notices via a web browser, just CLI. I double-checked to see what INI file was loaded and it's the one I expected to see: [pthomp...@pthompson scripts]$ php --ini Configuration File (php.ini) Path: /etc Loaded Configuration File: /etc/php.ini Thoughts on what's happening would be awesome! Thanks in advance. ~Philip Depending on what distro (I'm assuming Linux, who would run PHP on anything else? ;) ) you may have a separate php.ini for the CLI. I believe SUSE does this, and it could well be that other distros use a similar model. If you are running SUSE, the config files should be in /etc/php5/ Ash www.ashleysheridan.co.uk There are other .ini files located in /etc/php.d, but none specify error_reporting... ~Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CLI not obeying php.ini
Philip Thompson wrote: In my php.ini, I have error_reporting = E_ALL & ~E_NOTICE When I run a script from the command line, I get a lot of notices even when I said I don't want them. Also, in my script, I specified error_reporting(E_ERROR) in attempts to explicitly tell it what I want. It doesn't work either. Why am I still getting notices?! BTW, I don't receive notices via a web browser, just CLI. I double-checked to see what INI file was loaded and it's the one I expected to see: [pthomp...@pthompson scripts]$ php --ini Configuration File (php.ini) Path: /etc Loaded Configuration File: /etc/php.ini Thoughts on what's happening would be awesome! Thanks in advance. Are you including another script (eg pear mail or mbd2 or whatever)? Maybe it's setting something and overriding your attempt. A quick grep would be able to check that. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CLI not obeying php.ini
On Thu, 2009-02-05 at 15:45 -0600, Philip Thompson wrote: > In my php.ini, I have > > error_reporting = E_ALL & ~E_NOTICE > > When I run a script from the command line, I get a lot of notices > even when I said I don't want them. Also, in my script, I specified > error_reporting(E_ERROR) in attempts to explicitly tell it what I > want. It doesn't work either. > > Why am I still getting notices?! BTW, I don't receive notices via a > web browser, just CLI. > > I double-checked to see what INI file was loaded and it's the one I > expected to see: > > [pthomp...@pthompson scripts]$ php --ini > Configuration File (php.ini) Path: /etc > Loaded Configuration File: /etc/php.ini > > Thoughts on what's happening would be awesome! Thanks in advance. > > ~Philip > Depending on what distro (I'm assuming Linux, who would run PHP on anything else? ;) ) you may have a separate php.ini for the CLI. I believe SUSE does this, and it could well be that other distros use a similar model. If you are running SUSE, the config files should be in /etc/php5/ Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: DB Comparisons
On Thu, 2009-02-05 at 21:28 +, Nathan Rixham wrote: > Robert Cummings wrote: > > On Thu, 2009-02-05 at 21:03 +, Nathan Rixham wrote: > >> revDAVE wrote: > >>> Hi Folks, > >>> > >>> I¹m curious if there are any previous discussions / Articles / URL¹s that > >>> compare the power and scalability of MySQL (with php) with other > >>> technologies like MS sequel server oracle - coldfusion etc > >>> > >>> I imagine that most middleware like php / asp / coldfusion is relatively > >>> good & fast - (let me know if one is better ). Mostly I¹m concerned with > >>> the speed and power of the backend database as to how it functions on an > >>> enterprise scale such as how many hits it can handle per hour how many > >>> users before it starts to slow down etc. > >>> > >>> > >> honestly, if you're thinking enterprise scale then database is the least > >> of you're worries, you'll be needing to move away from a scripting > >> language and go for a pre compiled programming language. > > > > Isn't Yahoo using PHP? I thought Facebook too? Doesn't seem like they > > moved away from a scripting language. > > > > Cheers, > > Rob. > > only for the display tier in certain parts AFAIK, facebook had a good > success using APC cache; however the bulk of their "applications" are > certainly not php. > > ie: > > TIER 1 |-A : many many db servers > |<--( cluster / distribution point) > v > | > |-B : distributed caches (like terracotta) > |-C : entity manager / persistence manager > |-D : domain model > TIER 2 |-E : business logic > |-F : app interface / web service interface > |<--( cluster / distribution point) > v > | > |-G : web service client > TIER 3 |-H : display interface > | <--( cluster / distribution point) > v > HTTP > | > CLIENT |-I : end user client (web browser) > > that's vastly simplified with loads left out, a short time ago yahoo > rolled out 40k new apache hadoop servers - you really think the just > bolted a connector on the front ran a few php scripts then popped on > some caching? You said "move away from scripting", it doesn't seem as though they have. They've merely augmented their system with other tools. 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] Preserving History
2009/2/5 tedd : > To further the Garbage Collection thread on to another level (i.e., > preserving history) please consider this: > > Okay, let's say we have a table containing all the instances of tutors > teaching courses. A record might look like this: > > Course-to-Tutor table > course_id = 123 > tutor_id = 7 > date_active = 2/4/9 > date_inactive = null > > The above record was assembled from the following recrods: > > Tutor table: > id = 7 > name = joe > > Course table: > id = 123 > title = Introduction to Moonshine > > Okay, so let's now delete the course "Introduction to Moonshine"! > > At the first opportunity to search the Course-to-Tutor table we find that > the course 123 is now absent from our database and as such we set the > date_inactive field -- it won't be considered again. > > Okay, so what does that tell us about the history? It only provides that at > one time joe taught an undefined course. Furthermore, if joe quits, then we > only have a record that says someone with an id of 7 taught a course with an > id of 123 -- that doesn't make much sense, does it? > > Now, if we reconsider the Course-to-Tutor table and instead of putting in > the tutor_id and course_id, we put in the actual name of the tutor and title > of the class, then at least we have a history that makes sense. > > However by doing that, we violate the primary principle of a relational > database by creating redundant data. > > I guess that one can say that if we never actually delete the tutor nor the > course, but instead just make them inactive as well, then we have solved the > problem -- is that the answer? This is the way I would approach it. Once you've used an ID in a database you should never reuse it so long as there are references to it in other tables. If you need to exclude it from use you need a flag to indicate that. > In any event, what problems do you foresee if I used the actual names and > titles for the Course-to-Tutor table instead of their id's? After all, the > instance records would retain a simple history of what happened regardless > of deletions AND a search for "Introduction to Moonshine" should be > essentially as fast as a search for "123" if both fields are indexed, am I > right or wrong? If you need to change any of the names, e.g. to fix a typo, it's potentially a massive update, whereas it's a change to a single row if you use IDs. Another thing to bear in mind is the size of your indexes. IDs are small, strings are not. Having said that it depends on the DB server as some are better at handling string indexes than others. Depending on exactly what your history requirements are it may be worth exploring other options to maintaining a history. One of the sites I work on maintains an audit log such that if something gets deleted that gets recorded in a semi-structured but fairly generic way so if I need to know when record x was deleted from table y and what record x contained I can craft a SQL query to get that from the audit log table, albeit fairly slowly. I also records inserts and updates to create a complete record. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preserving History
tedd wrote: Hi gang: To further the Garbage Collection thread on to another level (i.e., preserving history) please consider this: Okay, let's say we have a table containing all the instances of tutors teaching courses. A record might look like this: Course-to-Tutor table course_id = 123 tutor_id = 7 date_active = 2/4/9 date_inactive = null The above record was assembled from the following recrods: Tutor table: id = 7 name = joe Course table: id = 123 title = Introduction to Moonshine Okay, so let's now delete the course "Introduction to Moonshine"! At the first opportunity to search the Course-to-Tutor table we find that the course 123 is now absent from our database and as such we set the date_inactive field -- it won't be considered again. Okay, so what does that tell us about the history? It only provides that at one time joe taught an undefined course. Furthermore, if joe quits, then we only have a record that says someone with an id of 7 taught a course with an id of 123 -- that doesn't make much sense, does it? So Joe quits - he has a "finishdate" or similar flag to say he's not attending the course any more. Now, if we reconsider the Course-to-Tutor table and instead of putting in the tutor_id and course_id, we put in the actual name of the tutor and title of the class, then at least we have a history that makes sense. However by doing that, we violate the primary principle of a relational database by creating redundant data. I guess that one can say that if we never actually delete the tutor nor the course, but instead just make them inactive as well, then we have solved the problem -- is that the answer? Mark the course as "not available" or something like that but I wouldn't delete it. Like you said, you lose all of the history if you did that. In any event, what problems do you foresee if I used the actual names and titles for the Course-to-Tutor table instead of their id's? After all, the instance records would retain a simple history of what happened regardless of deletions AND a search for "Introduction to Moonshine" should be essentially as fast as a search for "123" if both fields are indexed, am I right or wrong? The problem there is "oops typo" - now you either have: - a lot of secondary records to update (redundant data) - have to re-add everyone to the new course. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DB Comparisons
On Thu, Feb 05, 2009 at 12:36:02PM -0800, revDAVE wrote: > Hi Folks, > > I¹m curious if there are any previous discussions / Articles / URL¹s that > compare the power and scalability of MySQL (with php) with other > technologies like MS sequel server oracle - coldfusion etc > > I imagine that most middleware like php / asp / coldfusion is relatively > good & fast - (let me know if one is better ).Mostly I¹m concerned > with > the speed and power of the backend database as to how it functions on an > enterprise scale such as how many hits it can handle per hour > how many > users before it starts to slow down etc. > I don't know what backing DMBS Coldfusion uses, but Coldfusion requires server support of a proprietary nature. Likewise, MSSQL is a proprietary product, and I doubt it has the performance characteristics you need. In case it wasn't clear, I would always opt for an Open Source solution before any proprietary one. The arguments are well known. MySQL is not an enterprise database. And its most useful database types are owned by a large corporation which isn't entirely friendly towards the Open Source movement. It's only recently that MySQL has acquired some of the characteristics of enterprise DBMSes. For the longest time, MySQL relied on the programmer to handle his/her own foreign keys and such. It is very fast, and very suitable for web databases. And it has widespread API support in other languages. PostgreSQL *is* an enterprise database. It was designed from the beginning by DBAs, not programmers as MySQL was. It is comparable in performance to Oracle and MySQL, though this depends on the types of queries you're doing. But it has full transactional support, foreign keys, . And of course, it it not owned by a company and is fully Open Source. Feel free to flame me about this. I did a survey years ago before selecting PostgreSQL as our internal company DBMS. I've tracked the comparisons over the years, when PostgreSQL lagged in speed behind MySQL and seen PostgreSQL speed up. And I've seen MySQL add full-fledged DBMS features. So their capabilities have come closer and closer together. But I believe PostgreSQL is still the superior choice for an *enterprise* DBMS. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Preserving History
> > Hi gang: > > To further the Garbage Collection thread on to another level (i.e., > preserving history) please consider this: > > Okay, let's say we have a table containing all the instances of tutors > teaching courses. A record might look like this: > > Course-to-Tutor table > course_id = 123 > tutor_id = 7 > date_active = 2/4/9 > date_inactive = null > > The above record was assembled from the following recrods: > > Tutor table: > id = 7 > name = joe > > Course table: > id = 123 > title = Introduction to Moonshine > > Okay, so let's now delete the course "Introduction to Moonshine"! > > At the first opportunity to search the Course-to-Tutor table we find that > the course 123 is now absent from our database and as such we set the > date_inactive field -- it won't be considered again. > > Okay, so what does that tell us about the history? It only provides that at > one time joe taught an undefined course. Furthermore, if joe quits, then we > only have a record that says someone with an id of 7 taught a course with an > id of 123 -- that doesn't make much sense, does it? > > Now, if we reconsider the Course-to-Tutor table and instead of putting in > the tutor_id and course_id, we put in the actual name of the tutor and title > of the class, then at least we have a history that makes sense. > > However by doing that, we violate the primary principle of a relational > database by creating redundant data. > > I guess that one can say that if we never actually delete the tutor nor the > course, but instead just make them inactive as well, then we have solved the > problem -- is that the answer? > > In any event, what problems do you foresee if I used the actual names and > titles for the Course-to-Tutor table instead of their id's? After all, the > instance records would retain a simple history of what happened regardless > of deletions AND a search for "Introduction to Moonshine" should be > essentially as fast as a search for "123" if both fields are indexed, am I > right or wrong? > > Cheers, > > tedd > You only need to use ONE value in both tables. tutor_table: tutor_id = 7 first_name = joe last_name = smith active_tutor = Y course_table: course_id = 123 tutor_id = 7 title = Introduction to Moonshine active_course = Y A crude query to return all active tutors and their courses would be: SELECT tutor_table.first_name, tutor_table.last_name, course_table.title FROM tutor_table, course_table WHERE tutor_table.tutor_id = course_table.tutor_id AND tutor_table.active_tutor = 'Y' AND course_table.active_course = 'Y' That will return the course title and tutor name for all active events Hope that helps. Dan
Re: [PHP] DB Comparisons
Larry Garfield wrote: On Thu, 05 Feb 2009 12:36:02 -0800, revDAVE wrote: Hi Folks, I¹m curious if there are any previous discussions / Articles / URL¹s that compare the power and scalability of MySQL (with php) with other technologies like MS sequel server oracle - coldfusion etc I imagine that most middleware like php / asp / coldfusion is relatively good & fast - (let me know if one is better ). Mostly I¹m concerned with the speed and power of the backend database as to how it functions on an enterprise scale such as how many hits it can handle per hour how many users before it starts to slow down etc. 1) Define "enterprise scale". The word "enterprise" has no useful meaning other than "your software isn't ready for it, therefore you suck". :-) 2) How well do you know your DB? A well-tuned MySQL database will blow the crap out of a default config PostgreSQL server, but a well-tuned PostgreSQL server will wipe the floor with a badly configured mySQL database. Your knowledge of the underlying tool and how to get the most out of it will matter more than which vendor you go with, unless there are very specific features you require. On top of that, the types of queries you run will have an effect. Mysql works well with simple select * from table where id='x' type queries. Add some subqueries, aggregates (count/sum type thing) and it doesn't perform so well. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: DB Comparisons
2009/2/5 Nathan Rixham : > Robert Cummings wrote: >> >> On Thu, 2009-02-05 at 21:03 +, Nathan Rixham wrote: >>> >>> revDAVE wrote: Hi Folks, I¹m curious if there are any previous discussions / Articles / URL¹s that compare the power and scalability of MySQL (with php) with other technologies like MS sequel server oracle - coldfusion etc I imagine that most middleware like php / asp / coldfusion is relatively good & fast - (let me know if one is better ). Mostly I¹m concerned with the speed and power of the backend database as to how it functions on an enterprise scale such as how many hits it can handle per hour how many users before it starts to slow down etc. >>> honestly, if you're thinking enterprise scale then database is the least >>> of you're worries, you'll be needing to move away from a scripting language >>> and go for a pre compiled programming language. >> >> Isn't Yahoo using PHP? I thought Facebook too? Doesn't seem like they >> moved away from a scripting language. >> >> Cheers, >> Rob. > > only for the display tier in certain parts AFAIK, facebook had a good > success using APC cache; however the bulk of their "applications" are > certainly not php. > > ie: > > TIER 1 |-A : many many db servers >|<--( cluster / distribution point) >v >| > |-B : distributed caches (like terracotta) > |-C : entity manager / persistence manager > |-D : domain model > TIER 2 |-E : business logic > |-F : app interface / web service interface >|<--( cluster / distribution point) >v >| > |-G : web service client > TIER 3 |-H : display interface >| <--( cluster / distribution point) >v > HTTP >| > CLIENT |-I : end user client (web browser) > > that's vastly simplified with loads left out, a short time ago yahoo rolled > out 40k new apache hadoop servers - you really think the just bolted a > connector on the front ran a few php scripts then popped on some caching? >From http://blog.facebook.com/blog.php?post=2223862130... "Our Web servers use Linux and Apache and PHP. Our database servers run MySQL. We use memcached to help keep the site snappy. Some of our behind-the-scenes software is written in Python and Perl and Java, and we use gcc and Boost for the parts that aren't." Based on everything I've read there is very very little non-scripted code behind Facebook. The performance of a web-based application rarely has anything to do with the language it's written in. System architecture, caching levels and DB indexes have a far more profound effect on the performance of an app than whether it's compiled or scripted. To the OP: Which DB server you use is far less important than making sure you're using it right and optimising it as much as possible. Sure there are differences between them, and MySQL is better in certain situations than Postgres but a badly configured and optimised Postgres instance will always outperform a well configured and optimised MySQL server. "Enterprise" doesn't mean anything. if you're going to ask for platform and software performance comparisons you need to provide a lot more detail about what you're building, what skills you have available and what kind of budget you're working to. I've built websites at every level of complexity and every level of user base and I'm yet to find the one size fits all mix of software. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CLI not obeying php.ini
In my php.ini, I have error_reporting = E_ALL & ~E_NOTICE When I run a script from the command line, I get a lot of notices even when I said I don't want them. Also, in my script, I specified error_reporting(E_ERROR) in attempts to explicitly tell it what I want. It doesn't work either. Why am I still getting notices?! BTW, I don't receive notices via a web browser, just CLI. I double-checked to see what INI file was loaded and it's the one I expected to see: [pthomp...@pthompson scripts]$ php --ini Configuration File (php.ini) Path: /etc Loaded Configuration File: /etc/php.ini Thoughts on what's happening would be awesome! Thanks in advance. ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Preserving History
Hi gang: To further the Garbage Collection thread on to another level (i.e., preserving history) please consider this: Okay, let's say we have a table containing all the instances of tutors teaching courses. A record might look like this: Course-to-Tutor table course_id = 123 tutor_id = 7 date_active = 2/4/9 date_inactive = null The above record was assembled from the following recrods: Tutor table: id = 7 name = joe Course table: id = 123 title = Introduction to Moonshine Okay, so let's now delete the course "Introduction to Moonshine"! At the first opportunity to search the Course-to-Tutor table we find that the course 123 is now absent from our database and as such we set the date_inactive field -- it won't be considered again. Okay, so what does that tell us about the history? It only provides that at one time joe taught an undefined course. Furthermore, if joe quits, then we only have a record that says someone with an id of 7 taught a course with an id of 123 -- that doesn't make much sense, does it? Now, if we reconsider the Course-to-Tutor table and instead of putting in the tutor_id and course_id, we put in the actual name of the tutor and title of the class, then at least we have a history that makes sense. However by doing that, we violate the primary principle of a relational database by creating redundant data. I guess that one can say that if we never actually delete the tutor nor the course, but instead just make them inactive as well, then we have solved the problem -- is that the answer? In any event, what problems do you foresee if I used the actual names and titles for the Course-to-Tutor table instead of their id's? After all, the instance records would retain a simple history of what happened regardless of deletions AND a search for "Introduction to Moonshine" should be essentially as fast as a search for "123" if both fields are indexed, am I right or wrong? 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] DB Comparisons
On Thu, 05 Feb 2009 12:36:02 -0800, revDAVE wrote: > Hi Folks, > > I¹m curious if there are any previous discussions / Articles / URL¹s > that > compare the power and scalability of MySQL (with php) with other > technologies like MS sequel server oracle - coldfusion etc > > I imagine that most middleware like php / asp / coldfusion is relatively > good & fast - (let me know if one is better ). Mostly I¹m concerned with > the speed and power of the backend database as to how it functions on an > enterprise scale such as how many hits it can handle per hour how > many > users before it starts to slow down etc. 1) Define "enterprise scale". The word "enterprise" has no useful meaning other than "your software isn't ready for it, therefore you suck". :-) 2) How well do you know your DB? A well-tuned MySQL database will blow the crap out of a default config PostgreSQL server, but a well-tuned PostgreSQL server will wipe the floor with a badly configured mySQL database. Your knowledge of the underlying tool and how to get the most out of it will matter more than which vendor you go with, unless there are very specific features you require. --Larry Garfield -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: RES: [PHP] Bad words [SQL, database, txt, whatever]
On Thu, 2009-02-05 at 15:07 -0600, Shawn McKenzie wrote: > Ashley Sheridan wrote: > > On Wed, 2009-02-04 at 18:34 -0200, Jônatas Zechim wrote: > >> Thank you, but i thought one of you had the .sql or .txt, .xls, etc. > >> I had already find that results. > >> > >> But it's ok now.. > >> > >> zechim > >> > >> -Mensagem original- > >> De: Andrew Ballard [mailto:aball...@gmail.com] > >> Enviada em: quarta-feira, 4 de fevereiro de 2009 18:19 > >> Para: Jônatas Zechim > >> Cc: PHP-General List > >> Assunto: Re: [PHP] Bad words [SQL, database, txt, whatever] > >> > >> On Wed, Feb 4, 2009 at 2:48 PM, Jônatas Zechim > >> wrote: > >>> Hi there I don't know how to say 'palavrões'(i mean bad words, like f*** > >>> you, your bi***, as*) in English, but I need that. > >>> > >>> Anyone has or know where I can get a database, txt, whatever of 'bad words > >>> or 'palavrões'' > >>> > >>> zechim > >>> > >> http://www.google.com/search?hl=en&q=bad+word+dictionary&btnG=Google+Search > >> > >> http://www.google.com/search?hl=en&q=bad+word+list&btnG=Search&aq=f&oq= > >> > >> http://www.google.com/search?hl=en&q=bad+word+database&btnG=Search&aq=f&oq= > >> > >> Andrew > >> > >> > > It's not as simple as just blocking the bad words anyway, as people will > > find clever ways of getting round them such as $hit, sh1t, shi+, etc. > > Not only that, but just replacing words can cause it's own problems. I > > remember a lot of early basic filters (Hotmail anyone?) that prevented > > words like this, and any unfortunate with a surname of Hancock was left > > in a right mess! > > > > > > Ash > > www.ashleysheridan.co.uk > > > On my family website, my naive younger sister posted news about her > college graduation and had to type magnacumlaude, because she couldn't > understand why it kept coming out magna *** laude. > > -- > Thanks! > -Shawn > http://www.spidean.com > It's a mess isn't it? Best way I've found for situations where I need to filter content is to moderate it by hand. It's slow, but is less prone to problems. The moderator has to continually make a mess of things to let bad words through, where a programmer only has to mess it up once and the computer will continue to reject/accept whatever it wants! Also, a human moderator can put context to content, something which even the most sophisticated AI is incapable of. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: DB Comparisons
On Thu, 2009-02-05 at 16:19 -0500, Robert Cummings wrote: > On Thu, 2009-02-05 at 21:03 +, Nathan Rixham wrote: > > revDAVE wrote: > > > Hi Folks, > > > > > > I¹m curious if there are any previous discussions / Articles / URL¹s that > > > compare the power and scalability of MySQL (with php) with other > > > technologies like MS sequel server oracle - coldfusion etc > > > > > > I imagine that most middleware like php / asp / coldfusion is relatively > > > good & fast - (let me know if one is better ). Mostly I¹m concerned with > > > the speed and power of the backend database as to how it functions on an > > > enterprise scale such as how many hits it can handle per hour how many > > > users before it starts to slow down etc. > > > > > > > > > > honestly, if you're thinking enterprise scale then database is the least > > of you're worries, you'll be needing to move away from a scripting > > language and go for a pre compiled programming language. > > Isn't Yahoo using PHP? I thought Facebook too? Doesn't seem like they > moved away from a scripting language. > > Cheers, > Rob. > -- > http://www.interjinn.com > Application and Templating Framework for PHP > > As far as DB's are concerned, this is my experience: SQLLite is blindingly fast, but limited in functionality. For most small needs its fine though, and it is free. MySQL is fully powered and very fast, faster than MSSQL and Oracle, and it's free. Oracle is the slowest, but has a lot of features in to safeguard data against accidents, so is the best for critical apps where data loss would be a major issue. As far as I know it's also the most expensive. MSSQL is slow, and you need the latest versions to get the features you need (I'm stuck at work writing work-arounds for apps because they don't want to buy the latest versions!) SQLLite, MySQL and Oracle are all cross-platform, and MSSQL is Windows only. The major languages have modules that let you connect to all of the databases, although I think ASP can only connect to MSSQL and ASP.Net connects only to MSSQL and Oracle (but I'm not 100% certain on this) Also, as far as I'm aware, there are no drawbacks to mixing and matching the various DB's with the various languages. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: DB Comparisons
Robert Cummings wrote: On Thu, 2009-02-05 at 21:03 +, Nathan Rixham wrote: revDAVE wrote: Hi Folks, I¹m curious if there are any previous discussions / Articles / URL¹s that compare the power and scalability of MySQL (with php) with other technologies like MS sequel server oracle - coldfusion etc I imagine that most middleware like php / asp / coldfusion is relatively good & fast - (let me know if one is better ). Mostly I¹m concerned with the speed and power of the backend database as to how it functions on an enterprise scale such as how many hits it can handle per hour how many users before it starts to slow down etc. honestly, if you're thinking enterprise scale then database is the least of you're worries, you'll be needing to move away from a scripting language and go for a pre compiled programming language. Isn't Yahoo using PHP? I thought Facebook too? Doesn't seem like they moved away from a scripting language. Cheers, Rob. only for the display tier in certain parts AFAIK, facebook had a good success using APC cache; however the bulk of their "applications" are certainly not php. ie: TIER 1 |-A : many many db servers |<--( cluster / distribution point) v | |-B : distributed caches (like terracotta) |-C : entity manager / persistence manager |-D : domain model TIER 2 |-E : business logic |-F : app interface / web service interface |<--( cluster / distribution point) v | |-G : web service client TIER 3 |-H : display interface | <--( cluster / distribution point) v HTTP | CLIENT |-I : end user client (web browser) that's vastly simplified with loads left out, a short time ago yahoo rolled out 40k new apache hadoop servers - you really think the just bolted a connector on the front ran a few php scripts then popped on some caching? :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: DB Comparisons
On Thu, 2009-02-05 at 21:03 +, Nathan Rixham wrote: > revDAVE wrote: > > Hi Folks, > > > > I¹m curious if there are any previous discussions / Articles / URL¹s that > > compare the power and scalability of MySQL (with php) with other > > technologies like MS sequel server oracle - coldfusion etc > > > > I imagine that most middleware like php / asp / coldfusion is relatively > > good & fast - (let me know if one is better ). Mostly I¹m concerned with > > the speed and power of the backend database as to how it functions on an > > enterprise scale such as how many hits it can handle per hour how many > > users before it starts to slow down etc. > > > > > > honestly, if you're thinking enterprise scale then database is the least > of you're worries, you'll be needing to move away from a scripting > language and go for a pre compiled programming language. Isn't Yahoo using PHP? I thought Facebook too? Doesn't seem like they moved away from a scripting language. 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: RES: [PHP] Bad words [SQL, database, txt, whatever]
Ashley Sheridan wrote: > On Wed, 2009-02-04 at 18:34 -0200, Jônatas Zechim wrote: >> Thank you, but i thought one of you had the .sql or .txt, .xls, etc. >> I had already find that results. >> >> But it's ok now.. >> >> zechim >> >> -Mensagem original- >> De: Andrew Ballard [mailto:aball...@gmail.com] >> Enviada em: quarta-feira, 4 de fevereiro de 2009 18:19 >> Para: Jônatas Zechim >> Cc: PHP-General List >> Assunto: Re: [PHP] Bad words [SQL, database, txt, whatever] >> >> On Wed, Feb 4, 2009 at 2:48 PM, Jônatas Zechim wrote: >>> Hi there I don't know how to say 'palavrões'(i mean bad words, like f*** >>> you, your bi***, as*) in English, but I need that. >>> >>> Anyone has or know where I can get a database, txt, whatever of 'bad words >>> or 'palavrões'' >>> >>> zechim >>> >> http://www.google.com/search?hl=en&q=bad+word+dictionary&btnG=Google+Search >> >> http://www.google.com/search?hl=en&q=bad+word+list&btnG=Search&aq=f&oq= >> >> http://www.google.com/search?hl=en&q=bad+word+database&btnG=Search&aq=f&oq= >> >> Andrew >> >> > It's not as simple as just blocking the bad words anyway, as people will > find clever ways of getting round them such as $hit, sh1t, shi+, etc. > Not only that, but just replacing words can cause it's own problems. I > remember a lot of early basic filters (Hotmail anyone?) that prevented > words like this, and any unfortunate with a surname of Hancock was left > in a right mess! > > > Ash > www.ashleysheridan.co.uk > On my family website, my naive younger sister posted news about her college graduation and had to type magnacumlaude, because she couldn't understand why it kept coming out magna *** laude. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: DB Comparisons
revDAVE wrote: Hi Folks, I¹m curious if there are any previous discussions / Articles / URL¹s that compare the power and scalability of MySQL (with php) with other technologies like MS sequel server oracle - coldfusion etc I imagine that most middleware like php / asp / coldfusion is relatively good & fast - (let me know if one is better ). Mostly I¹m concerned with the speed and power of the backend database as to how it functions on an enterprise scale such as how many hits it can handle per hour how many users before it starts to slow down etc. honestly, if you're thinking enterprise scale then database is the least of you're worries, you'll be needing to move away from a scripting language and go for a pre compiled programming language. if you must script this then mysql cluster is probably you're best route to gain what you need, any of the others and you're (probably) going to run into transactional problems especially with multi-master replication. Primarily though one would imagine you'll be doing more reads than writes, in which case you'll be needing a lot of caching in there, second level not just the sql query cache. Using PHP and suchlike is possible for an enterprise ap, but only if you bolt on massive amounts of caching at both the data side and the presentation side of your app. Back to specifics, how the back end database will bear up in an enterprise situation (you'll like this) assuming that all your tables are properly created and optimised assuming you've indexed everything perfectly after analysing every sql query assuming you've optimised every sql query perfectly and you're database is normalised and optimised for you're application structure assuming you've configured all the database server variables correctly for the application and to make the most of the hardware assuming the physical server is of a decent specification and not an old pentium 3 with 128mb ram assuming you're application is well optimised and with no caches then: you'll find 1 database server will support approx 2 UI (user interface) servers of a similar running at full tilt - but you've got a single point of failure by only having one db server so you'll need to look at that :p all in all, with a web app that's scripted you need not worry about which database server to use, pick one from preference and to budget and roll with it. IMHO go php mysql, tonnes of reference online, loads of help, cheaper than going m$sql with windows hosting, and easier to dive in to and use well than postgres. ps: when you've covered all those "assuming(s)" above come back and we'll give you a better idea of where to go next based on the info you give us. Regards :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DB Comparisons
Hi Folks, I¹m curious if there are any previous discussions / Articles / URL¹s that compare the power and scalability of MySQL (with php) with other technologies like MS sequel server oracle - coldfusion etc I imagine that most middleware like php / asp / coldfusion is relatively good & fast - (let me know if one is better ). Mostly I¹m concerned with the speed and power of the backend database as to how it functions on an enterprise scale such as how many hits it can handle per hour how many users before it starts to slow down etc. -- Thanks - RevDave Cool @ hosting4days . com [db-lists 09]
Re: RES: [PHP] Connect local app to a web app
Jônatas Zechim wrote: > Ok, i have a app running on a website writen in php that insert data into a > database(web) every 3s all day long, and I need to get this data(every 3s > too) and save into local database, both are mysql database, but I don't know > the best way to do it, with socks, XML, XML-RPC. > > Thanks > > Zechim. > > -Mensagem original- > De: Jim Lucas [mailto:li...@cmsws.com] > Enviada em: quinta-feira, 5 de fevereiro de 2009 18:13 > Para: Alpár Török > Cc: Paul M Foster; php-general@lists.php.net > Assunto: Re: [PHP] Connect local app to a web app > > Alpár Török wrote: >> 2009/2/5 Alpár Török >> >>> 2009/2/5 Paul M Foster >>> >>> On Thu, Feb 05, 2009 at 05:24:45PM -0200, Jônatas Zechim wrote: > Hi there, i'm here again, but now with another doubt. > > What's the best way to connect a local app write in php or php-gtk to a web > app writen in php. > The database is MySql, and i need to do this connection every 3s to check > data, get the data back and save into localhost database. > If you have control of the server, you can just set this up in a bash script, using mysql commands, which connect to the remote and then then local databases. I'm talking about cron running the script periodically. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php >>> You can set up a web service using XML-RPC or JSON-RPC , you don't >>> necessarily need a db >>> >> PS: I meant you don't need the db locally >> > > except for the fact that the op said he wanted to *save* it to a *localhost > database*. > >>> -- >>> Alpar Torok >>> >> >> > > Personally, I would look at mysql replication running locally on your mysql database. It is handled completely by mysql. No need to use other applications or languages to reproduce the replication ability already designed into mysql. -- 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
Re: [PHP] Re: More questions about SESSION use
Just use a session_start() before any output to the server, and the > sessions array will be available to your code. > > > Ash > www.ashleysheridan.co.uk > > Ah ha...and now I know why my O'reilly book Web Database Applications with PHP was so inexpensive... :) it's outdated...oops...
Re: [PHP] Is it possible to send POST vars through aheaderredirect?
tedd wrote: > At 1:18 PM -0600 2/5/09, Shawn McKenzie wrote: >> tedd wrote: >>> At 2:52 AM -0700 2/5/09, TS wrote: I want my script to run and redirect with the var to another page without the user seeing it. Currently, I am using GET and header("Location: http://domain/?somevar=somevalue";) >>> >>> That would, by definition, allow the user to see it. >>> >>> If you want to pass a variable to another script, I know of four >>> choices, namely: >>> >>> 1. Use POST; >>> 2. Use GET; >>> 3. Write the variable to a database; >>> 4. Include the next script. >>> >>> HTH's >>> >>> tedd >>> >> >> 5. Stick it in the session >> >> -- >> Thanks! >> -Shawn > > Duh! > > Thanks, I should wait a day before posting anything. > > tedd > Only a day? Sometimes I click send before I'm even finished ty -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RES: [PHP] Connect local app to a web app
Ok, i have a app running on a website writen in php that insert data into a database(web) every 3s all day long, and I need to get this data(every 3s too) and save into local database, both are mysql database, but I don't know the best way to do it, with socks, XML, XML-RPC. Thanks Zechim. -Mensagem original- De: Jim Lucas [mailto:li...@cmsws.com] Enviada em: quinta-feira, 5 de fevereiro de 2009 18:13 Para: Alpár Török Cc: Paul M Foster; php-general@lists.php.net Assunto: Re: [PHP] Connect local app to a web app Alpár Török wrote: > 2009/2/5 Alpár Török > >> >> 2009/2/5 Paul M Foster >> >> On Thu, Feb 05, 2009 at 05:24:45PM -0200, Jônatas Zechim wrote: Hi there, i'm here again, but now with another doubt. What's the best way to connect a local app write in php or php-gtk to a >>> web app writen in php. The database is MySql, and i need to do this connection every 3s to >>> check data, get the data back and save into localhost database. >>> If you have control of the server, you can just set this up in a bash >>> script, using mysql commands, which connect to the remote and then then >>> local databases. I'm talking about cron running the script periodically. >>> >>> Paul >>> >>> -- >>> Paul M. Foster >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >> You can set up a web service using XML-RPC or JSON-RPC , you don't >> necessarily need a db >> > PS: I meant you don't need the db locally > except for the fact that the op said he wanted to *save* it to a *localhost database*. >> -- >> Alpar Torok >> > > > -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Connect local app to a web app
Alpár Török wrote: > 2009/2/5 Alpár Török > >> >> 2009/2/5 Paul M Foster >> >> On Thu, Feb 05, 2009 at 05:24:45PM -0200, Jônatas Zechim wrote: Hi there, i'm here again, but now with another doubt. What's the best way to connect a local app write in php or php-gtk to a >>> web app writen in php. The database is MySql, and i need to do this connection every 3s to >>> check data, get the data back and save into localhost database. >>> If you have control of the server, you can just set this up in a bash >>> script, using mysql commands, which connect to the remote and then then >>> local databases. I'm talking about cron running the script periodically. >>> >>> Paul >>> >>> -- >>> Paul M. Foster >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >> You can set up a web service using XML-RPC or JSON-RPC , you don't >> necessarily need a db >> > PS: I meant you don't need the db locally > except for the fact that the op said he wanted to *save* it to a *localhost database*. >> -- >> Alpar Torok >> > > > -- 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
Re: [PHP] Connect local app to a web app
2009/2/5 Alpár Török > > > 2009/2/5 Paul M Foster > > On Thu, Feb 05, 2009 at 05:24:45PM -0200, Jônatas Zechim wrote: >> >> > Hi there, i'm here again, but now with another doubt. >> > >> > What's the best way to connect a local app write in php or php-gtk to a >> web >> > app writen in php. >> > The database is MySql, and i need to do this connection every 3s to >> check >> > data, get the data back and save into localhost database. >> > >> >> If you have control of the server, you can just set this up in a bash >> script, using mysql commands, which connect to the remote and then then >> local databases. I'm talking about cron running the script periodically. >> >> Paul >> >> -- >> Paul M. Foster >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > You can set up a web service using XML-RPC or JSON-RPC , you don't > necessarily need a db > PS: I meant you don't need the db locally > > -- > Alpar Torok > -- Alpar Torok
Re: [PHP] Connect local app to a web app
2009/2/5 Paul M Foster > On Thu, Feb 05, 2009 at 05:24:45PM -0200, Jônatas Zechim wrote: > > > Hi there, i'm here again, but now with another doubt. > > > > What's the best way to connect a local app write in php or php-gtk to a > web > > app writen in php. > > The database is MySql, and i need to do this connection every 3s to check > > data, get the data back and save into localhost database. > > > > If you have control of the server, you can just set this up in a bash > script, using mysql commands, which connect to the remote and then then > local databases. I'm talking about cron running the script periodically. > > Paul > > -- > Paul M. Foster > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > You can set up a web service using XML-RPC or JSON-RPC , you don't necessarily need a db -- Alpar Torok
RE: [PHP] Connect local app to a web app
hi... can you describe in psuedocode what you're trying to accomplish? might be able to help if i have a better understanding of where you're trying to go. -Original Message- From: Jônatas Zechim [mailto:zechim@gmail.com] Sent: Thursday, February 05, 2009 11:25 AM To: php-general@lists.php.net Subject: [PHP] Connect local app to a web app Hi there, i'm here again, but now with another doubt. What's the best way to connect a local app write in php or php-gtk to a web app writen in php. The database is MySql, and i need to do this connection every 3s to check data, get the data back and save into localhost database. -- 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] Connect local app to a web app
On Thu, Feb 05, 2009 at 05:24:45PM -0200, Jônatas Zechim wrote: > Hi there, i'm here again, but now with another doubt. > > What's the best way to connect a local app write in php or php-gtk to a web > app writen in php. > The database is MySql, and i need to do this connection every 3s to check > data, get the data back and save into localhost database. > If you have control of the server, you can just set this up in a bash script, using mysql commands, which connect to the remote and then then local databases. I'm talking about cron running the script periodically. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Connect local app to a web app
Jônatas Zechim wrote: > Hi there, i'm here again, but now with another doubt. > > What's the best way to connect a local app write in php or php-gtk to a web > app writen in php. > The database is MySql, and i need to do this connection every 3s to check > data, get the data back and save into localhost database. > > Mysql replication... :) -- 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
Re: [PHP] Garbage Collection
On Thu, Feb 05, 2009 at 02:48:14PM -0500, tedd wrote: > At 7:03 PM + 2/5/09, Nathan Rixham wrote: >> IMHO forget the active flag, replace it with a field "deleted" which >> is a timestamp, then you've got an audit trail of when the it was >> removed :) >> >> infact often seen three fields on every table, "inserted, updated >> and deleted" all timestamps and self explanatory. > > Nathan: > > As usual, you (and others on this list) have clarity on this. > > I think I'll go your route except I'll have a "date created" and > "date inactive" field but not a "date updated" field. > > In this situation there would never be a reason for an update. After > all, the tutor_course record is created when an assignment is made -- > when the assignment is broken, then the record becomes inactive. So, > there's no reason to update. "Do, or don't do, there is no try." -- > Yoda Actually, if I needed a history, I wouldn't do it with timestamp fields in the table. I'd build a new file that contained the history. Maybe when timestamp operation char(1) what char(1) which id Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Blank page of hell..what to look for
Maybe X-Debug (http://www.xdebug.org/) could help you find bugs in your code, and for development environments it's recommended to use the most sensitive level of messages (turn on E_STRICT and E_NOTIVE, for example). 2009/2/5 Ashley Sheridan > > On Thu, 2009-02-05 at 12:22 -0500, Paul M Foster wrote: > > On Thu, Feb 05, 2009 at 11:11:03AM -0600, Terion Miller wrote: > > > > > > > > Speaking of IDE, which do people on here prefer, I have been using > > > Dreamweaver CS3 just because as originally a designer I was/am used to > > > it... > > > I did finally find the problem but moving an echo("damnit"); from line to > > > line commenting out everything below it...Oi ...is this ever going to get > > > easier for me I often wonder... > > > > Use Vim. ;-} > > > > Paul > > -- > > Paul M. Foster > > > Any editor with coloured syntax highlighting will help. Just scanning > through the script visually should let you spot the obvious errors, and > then breaking the script down into chunks with echo statements is the > next step. You don't need to break it down line by line, that takes > ages! Instead, put one halfway through your code, that will let you know > if the error is in the top or bottom half, then just keep breaking it > down half at a time and soon you'll have the part the error is in. It's > just a typical trial-and-error algorithm. > > > Ash > www.ashleysheridan.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
Re: [PHP] Re: More questions about SESSION use
On Thu, 2009-02-05 at 11:16 -0600, Terion Miller wrote: > On Mon, Feb 2, 2009 at 4:18 PM, Chris wrote: > > > Edmund Hertle wrote: > > > >> 2009/2/1 Terion Miller > >> > >> This is how it was originally written: > > if (empty($_SESSION['AdminLogin']) || $_SESSION['AdminLogin'] != > > > true){ > >>> > header ("Location: LogOut.php"); > >$_SESSION['user']=$UserName; > >$_SESSION['AdminID']=$AdminID; <--*I added this one originally the > > script only used 'user' and 'AdminLogin'* but passed them in urls > > } > > > > >> Those two lines after header() will not be executed. > >> > > > > Yes they will because there is no 'exit'. > > > > Header is just a function call, if you want to stop processing you have to > > do it yourself. > > > > -- > > Postgresql & php tutorials > > http://www.designmagick.com/ > > > > Is it better to use the session_register() could that be my issue ,although > my sessions are passing from page to page so they are registered? right... > is this part of that loose format that php coders just love and I > hate..because it to me makes learning it hard... > t. Just use a session_start() before any output to the server, and the sessions array will be available to your code. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: More questions about SESSION use
On Thu, Feb 5, 2009 at 9:16 AM, Terion Miller wrote: > On Mon, Feb 2, 2009 at 4:18 PM, Chris wrote: > > > Edmund Hertle wrote: > > > >> 2009/2/1 Terion Miller > >> > >> This is how it was originally written: > > if (empty($_SESSION['AdminLogin']) || $_SESSION['AdminLogin'] != > > > true){ > >>> > header ("Location: LogOut.php"); > >$_SESSION['user']=$UserName; > >$_SESSION['AdminID']=$AdminID; <--*I added this one originally the > > script only used 'user' and 'AdminLogin'* but passed them in urls > > } > > > > >> Those two lines after header() will not be executed. > >> > > > > Yes they will because there is no 'exit'. > > > > Header is just a function call, if you want to stop processing you have > to > > do it yourself. > > > > -- > > Postgresql & php tutorials > > http://www.designmagick.com/ > > > > Is it better to use the session_register() could that be my issue ,although > my sessions are passing from page to page so they are registered? right... > is this part of that loose format that php coders just love and I > hate..because it to me makes learning it hard... > t. FYI session_register is deprecated in PHP 5.3.0 and completely going away in PHP 6.0. Please don't use it. Thanks, V
Re: [PHP] Garbage Collection
At 7:03 PM + 2/5/09, Nathan Rixham wrote: IMHO forget the active flag, replace it with a field "deleted" which is a timestamp, then you've got an audit trail of when the it was removed :) infact often seen three fields on every table, "inserted, updated and deleted" all timestamps and self explanatory. Nathan: As usual, you (and others on this list) have clarity on this. I think I'll go your route except I'll have a "date created" and "date inactive" field but not a "date updated" field. In this situation there would never be a reason for an update. After all, the tutor_course record is created when an assignment is made -- when the assignment is broken, then the record becomes inactive. So, there's no reason to update. "Do, or don't do, there is no try." -- Yoda 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
Re: [PHP] Blank page of hell..what to look for
On Thu, 2009-02-05 at 12:22 -0500, Paul M Foster wrote: > On Thu, Feb 05, 2009 at 11:11:03AM -0600, Terion Miller wrote: > > > > > Speaking of IDE, which do people on here prefer, I have been using > > Dreamweaver CS3 just because as originally a designer I was/am used to it... > > I did finally find the problem but moving an echo("damnit"); from line to > > line commenting out everything below it...Oi ...is this ever going to get > > easier for me I often wonder... > > Use Vim. ;-} > > Paul > -- > Paul M. Foster > Any editor with coloured syntax highlighting will help. Just scanning through the script visually should let you spot the obvious errors, and then breaking the script down into chunks with echo statements is the next step. You don't need to break it down line by line, that takes ages! Instead, put one halfway through your code, that will let you know if the error is in the top or bottom half, then just keep breaking it down half at a time and soon you'll have the part the error is in. It's just a typical trial-and-error algorithm. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] German characters Ö,Ä etc. show up as ?
On Thu, 2009-02-05 at 13:37 +0100, Merlin Morgenstern wrote: > Hi there, > > I recently upgraded on my prod system from php 4.x to the newest php > version. Now german characters lik "Ö" show up as ?. I have the same > setup running on a test server, where the characters show up OK. After > searching on Google I found that there is an entry in the php.ini: > default_charset = "iso-8859-1" which could help me, however this is not > set in the test environment! How come? Is there another way to fix this? > > Kind regards,Merlin > Can you not add it to the php.ini in the live environment? Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Connect local app to a web app
Hi there, i'm here again, but now with another doubt. What's the best way to connect a local app write in php or php-gtk to a web app writen in php. The database is MySql, and i need to do this connection every 3s to check data, get the data back and save into localhost database. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to send POST vars through a headerredirect?
At 1:18 PM -0600 2/5/09, Shawn McKenzie wrote: tedd wrote: At 2:52 AM -0700 2/5/09, TS wrote: I want my script to run and redirect with the var to another page without the user seeing it. Currently, I am using GET and header("Location: http://domain/?somevar=somevalue";) That would, by definition, allow the user to see it. If you want to pass a variable to another script, I know of four choices, namely: 1. Use POST; 2. Use GET; 3. Write the variable to a database; 4. Include the next script. HTH's tedd 5. Stick it in the session -- Thanks! -Shawn Duh! Thanks, I should wait a day before posting anything. 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] Is it possible to send POST vars through a headerredirect?
tedd wrote: > At 2:52 AM -0700 2/5/09, TS wrote: >> I want my script to run and redirect with >> the var to another page without the user seeing it. Currently, I am using >> GET and >> >> header("Location: http://domain/?somevar=somevalue";) > > That would, by definition, allow the user to see it. > > If you want to pass a variable to another script, I know of four > choices, namely: > > 1. Use POST; > 2. Use GET; > 3. Write the variable to a database; > 4. Include the next script. > > HTH's > > tedd > 5. Stick it in the session -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Garbage Collection
Dan Shirah wrote: Hi gang: A related question to my last "Clarity needed" post. I have a tutor table (showing all the tutors), a course table (showing all the courses), and a course-to-tutor table (showing all the instances of what tutor teaches what course). Okay, everything works. Whenever I want to find out what courses a specific tutor teaches OR what tutors teach a specific course, I simply search the course-to-tutor table and bingo out pops the answer. Now, how do you handle the situation when a tutor quits or when a course is no longer offered? If I search the course-to-tutor table for all the tutors who teach a course and find a tutor who is no longer there OR search the course-to-tutor table for all the courses a tutor teaches and find a course that is no longer offered, how do you handle the record? I realize that if either search turns up nothing, I can check for that situation and then handle it accordingly. But my question is more specifically, in the event of a tutor quilting OR removing a course from the curriculum, what do you do about the course-to-tutor orphaned record? As I see it, my choices are to a) ignore the orphaned record or b) delete the orphaned record. If I ignore the record, then the database grows with orphaned records and searches are slowed. If I delete the orphaned record, then the problem is solved, right? I just want to get a consensus of how you people normally handle it. Do any of you see in danger in deleting an orphaned record? Cheers, tedd I guess that all depends. If you want some kind of historical log of what tutor taught which course and which courses have previously been offered then I wouldn't delete the records. Instead I would and something like a "Active" column and use simple "Y" and "N" vaules to mark each tutor or course as active and then just re-write your query to only pull tutor's/courses with the "Y" flag. That would give you a current listing of active courses and who teaches them, and also retain the historical data if it need to be referenced later. IMHO forget the active flag, replace it with a field "deleted" which is a timestamp, then you've got an audit trail of when the it was removed :) infact often seen three fields on every table, "inserted, updated and deleted" all timestamps and self explanatory. regards! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Clarity needed
On Thu, Feb 5, 2009 at 07:56, Jochem Maas wrote: > > and the answer to you Q, like everyone else said: yup :-) > > PS - given you unlimited resources you might consider doing a > charitable donation to FoxNews aficionados :-) Or reminding you how to speak English, Jochem. What the hell are you trying to say here?!? ;-P Man, a guy disappears for a while and his speech goes to gibberish almost as bad as my own. ;-P -- daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Unadvertised dedicated server deals, too low to print - email me to find out! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Blank page of hell..what to look for
On Thu, Feb 05, 2009 at 11:11:03AM -0600, Terion Miller wrote: > > Speaking of IDE, which do people on here prefer, I have been using > Dreamweaver CS3 just because as originally a designer I was/am used to it... > I did finally find the problem but moving an echo("damnit"); from line to > line commenting out everything below it...Oi ...is this ever going to get > easier for me I often wonder... Use Vim. ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: More questions about SESSION use
On Mon, Feb 2, 2009 at 4:18 PM, Chris wrote: > Edmund Hertle wrote: > >> 2009/2/1 Terion Miller >> >> This is how it was originally written: > if (empty($_SESSION['AdminLogin']) || $_SESSION['AdminLogin'] != > true){ >>> header ("Location: LogOut.php"); >$_SESSION['user']=$UserName; >$_SESSION['AdminID']=$AdminID; <--*I added this one originally the > script only used 'user' and 'AdminLogin'* but passed them in urls > } > >> Those two lines after header() will not be executed. >> > > Yes they will because there is no 'exit'. > > Header is just a function call, if you want to stop processing you have to > do it yourself. > > -- > Postgresql & php tutorials > http://www.designmagick.com/ > Is it better to use the session_register() could that be my issue ,although my sessions are passing from page to page so they are registered? right... is this part of that loose format that php coders just love and I hate..because it to me makes learning it hard... t.
Re: [PHP] Blank page of hell..what to look for
> > > Better yet, use a IDE the does code highlighting. This would point you to > the problem rather quickly. > > -- > 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 > Speaking of IDE, which do people on here prefer, I have been using Dreamweaver CS3 just because as originally a designer I was/am used to it... I did finally find the problem but moving an echo("damnit"); from line to line commenting out everything below it...Oi ...is this ever going to get easier for me I often wonder...
Re: [PHP] Garbage Collection
On Thu, Feb 5, 2009 at 11:10 AM, Eric Butera wrote: > On Thu, Feb 5, 2009 at 11:06 AM, tedd wrote: > > Hi gang: > > > > A related question to my last "Clarity needed" post. > > > > I have a tutor table (showing all the tutors), a course table (showing > all > > the courses), and a course-to-tutor table (showing all the instances of > what > > tutor teaches what course). > > > > Okay, everything works. Whenever I want to find out what courses a > specific > > tutor teaches OR what tutors teach a specific course, I simply search the > > course-to-tutor table and bingo out pops the answer. > > > > Now, how do you handle the situation when a tutor quits or when a course > is > > no longer offered? > > > > If I search the course-to-tutor table for all the tutors who teach a > course > > and find a tutor who is no longer there OR search the course-to-tutor > table > > for all the courses a tutor teaches and find a course that is no longer > > offered, how do you handle the record? > > > > I realize that if either search turns up nothing, I can check for that > > situation and then handle it accordingly. But my question is more > > specifically, in the event of a tutor quilting OR removing a course from > the > > curriculum, what do you do about the course-to-tutor orphaned record? > > > > As I see it, my choices are to a) ignore the orphaned record or b) delete > > the orphaned record. If I ignore the record, then the database grows with > > orphaned records and searches are slowed. If I delete the orphaned > record, > > then the problem is solved, right? > > > > I just want to get a consensus of how you people normally handle it. Do > any > > of you see in danger in deleting an orphaned record? > > > > 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 > > > > > > Could add a status flag to the records to indicate if they're active > or not. Or you could use InnoDB and have it cascade delete join > records. Status is nice though in case they come back or to provide > an undelete type functionality. > > -- > http://www.voom.me | EFnet: #voom > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > this gets my vote -- Bastien Cat, the other other white meat
Re: [PHP] kadm5 Library
> Did you try to install krb5-devel. Try "yum search krb5" to > see all the available packages that CentOS includes. In > case your yum doesn't find something you may add more > repos like Dag's: I did. The krb5-devel package is the one that installed krb5/krb5.h, but as I mentioned that seems to be a different version than the one that the PECL library expects. I've used Dag's repository before, but as you pointed out, it doesn't contain this package. > What you need is to find a kerberos rpm to include development > header in order to compile it your self. I thought about grabbing the header from another OS, but I'm concerned about incompatibilities. For now, I'm just using the expect library and running kadmin.local via sudo as needed. It's clunky, but it's working. :) Thanks for all your help! Tim Gustafson BSOE Webmaster UC Santa Cruz t...@soe.ucsc.edu 831-459-5354 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Garbage Collection
> > Hi gang: > > A related question to my last "Clarity needed" post. > > I have a tutor table (showing all the tutors), a course table (showing all > the courses), and a course-to-tutor table (showing all the instances of what > tutor teaches what course). > > Okay, everything works. Whenever I want to find out what courses a specific > tutor teaches OR what tutors teach a specific course, I simply search the > course-to-tutor table and bingo out pops the answer. > > Now, how do you handle the situation when a tutor quits or when a course is > no longer offered? > > If I search the course-to-tutor table for all the tutors who teach a course > and find a tutor who is no longer there OR search the course-to-tutor table > for all the courses a tutor teaches and find a course that is no longer > offered, how do you handle the record? > > I realize that if either search turns up nothing, I can check for that > situation and then handle it accordingly. But my question is more > specifically, in the event of a tutor quilting OR removing a course from the > curriculum, what do you do about the course-to-tutor orphaned record? > > As I see it, my choices are to a) ignore the orphaned record or b) delete > the orphaned record. If I ignore the record, then the database grows with > orphaned records and searches are slowed. If I delete the orphaned record, > then the problem is solved, right? > > I just want to get a consensus of how you people normally handle it. Do any > of you see in danger in deleting an orphaned record? > > Cheers, > > tedd > I guess that all depends. If you want some kind of historical log of what tutor taught which course and which courses have previously been offered then I wouldn't delete the records. Instead I would and something like a "Active" column and use simple "Y" and "N" vaules to mark each tutor or course as active and then just re-write your query to only pull tutor's/courses with the "Y" flag. That would give you a current listing of active courses and who teaches them, and also retain the historical data if it need to be referenced later. If you don't care about historical data, you could just do a DELETE FROM my_table where course/tutor id = "x" But I would recreate an index on the table after deletion of records to keep the speed crisp. Dan
RE: [PHP] Garbage Collection
> -Original Message- > From: tedd [mailto:t...@sperling.com] > Sent: Thursday, February 05, 2009 10:07 AM > To: php-general@lists.php.net > Subject: [PHP] Garbage Collection > > Hi gang: > > A related question to my last "Clarity needed" post. > > I have a tutor table (showing all the tutors), a course table > (showing all the courses), and a course-to-tutor table (showing all > the instances of what tutor teaches what course). > > Okay, everything works. Whenever I want to find out what courses a > specific tutor teaches OR what tutors teach a specific course, I > simply search the course-to-tutor table and bingo out pops the answer. > > Now, how do you handle the situation when a tutor quits or when a > course is no longer offered? > > If I search the course-to-tutor table for all the tutors who teach a > course and find a tutor who is no longer there OR search the > course-to-tutor table for all the courses a tutor teaches and find a > course that is no longer offered, how do you handle the record? > > I realize that if either search turns up nothing, I can check for > that situation and then handle it accordingly. But my question is > more specifically, in the event of a tutor quilting OR removing a > course from the curriculum, what do you do about the course-to-tutor > orphaned record? > > As I see it, my choices are to a) ignore the orphaned record or b) > delete the orphaned record. If I ignore the record, then the database > grows with orphaned records and searches are slowed. If I delete the > orphaned record, then the problem is solved, right? > > I just want to get a consensus of how you people normally handle it. > Do any of you see in danger in deleting an orphaned record? tedd, I believe relational integrity can solve your problem. In MySQL (and maybe MSSQL, but I am less "versed" with that product) you should be able to put a CASCADE option on the DELETE action for your tutor table so that when a record is deleted, its associated record in tutors-to-courses is also deleted. I'm assuming you would want to do the same for removing a record in tutors-to-courses when a course is removed (but not remove the tutor, the same as you do not remove the course itself when the tutor is deleted). I suppose you could also do it yourself with PHP code when a failed link is turned up, but why bother separating DB logic from the DB itself? :) HTH, // Todd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Garbage Collection
On Thu, Feb 5, 2009 at 11:06 AM, tedd wrote: > Hi gang: > > A related question to my last "Clarity needed" post. > > I have a tutor table (showing all the tutors), a course table (showing all > the courses), and a course-to-tutor table (showing all the instances of what > tutor teaches what course). > > Okay, everything works. Whenever I want to find out what courses a specific > tutor teaches OR what tutors teach a specific course, I simply search the > course-to-tutor table and bingo out pops the answer. > > Now, how do you handle the situation when a tutor quits or when a course is > no longer offered? > > If I search the course-to-tutor table for all the tutors who teach a course > and find a tutor who is no longer there OR search the course-to-tutor table > for all the courses a tutor teaches and find a course that is no longer > offered, how do you handle the record? > > I realize that if either search turns up nothing, I can check for that > situation and then handle it accordingly. But my question is more > specifically, in the event of a tutor quilting OR removing a course from the > curriculum, what do you do about the course-to-tutor orphaned record? > > As I see it, my choices are to a) ignore the orphaned record or b) delete > the orphaned record. If I ignore the record, then the database grows with > orphaned records and searches are slowed. If I delete the orphaned record, > then the problem is solved, right? > > I just want to get a consensus of how you people normally handle it. Do any > of you see in danger in deleting an orphaned record? > > 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 > > Could add a status flag to the records to indicate if they're active or not. Or you could use InnoDB and have it cascade delete join records. Status is nice though in case they come back or to provide an undelete type functionality. -- http://www.voom.me | EFnet: #voom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Garbage Collection
Hi gang: A related question to my last "Clarity needed" post. I have a tutor table (showing all the tutors), a course table (showing all the courses), and a course-to-tutor table (showing all the instances of what tutor teaches what course). Okay, everything works. Whenever I want to find out what courses a specific tutor teaches OR what tutors teach a specific course, I simply search the course-to-tutor table and bingo out pops the answer. Now, how do you handle the situation when a tutor quits or when a course is no longer offered? If I search the course-to-tutor table for all the tutors who teach a course and find a tutor who is no longer there OR search the course-to-tutor table for all the courses a tutor teaches and find a course that is no longer offered, how do you handle the record? I realize that if either search turns up nothing, I can check for that situation and then handle it accordingly. But my question is more specifically, in the event of a tutor quilting OR removing a course from the curriculum, what do you do about the course-to-tutor orphaned record? As I see it, my choices are to a) ignore the orphaned record or b) delete the orphaned record. If I ignore the record, then the database grows with orphaned records and searches are slowed. If I delete the orphaned record, then the problem is solved, right? I just want to get a consensus of how you people normally handle it. Do any of you see in danger in deleting an orphaned record? 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] cgi vs php
Thodoris napsal(a): Y In cgi i can use perl ,c etc suppose i use perl now how efficiency differs? How cgi written in perl and php is differ in working in context of web service? other difference?. but their differ. On Thu, Feb 5, 2009 at 6:45 PM, Jay Blanchard wrote: [snip] can anybody tell me the benefits of php over cgi or vice versa? i need to compare both? [/snip] CGI is a gateway to be used by languages PHP is a language First of all try not to top post this is what we usually do here. Well CGI is a standard protocol implemented by many programming languages. You may start googling to find about it but this is a start: http://en.wikipedia.org/wiki/Common_Gateway_Interface Both Perl and PHP can work with CGI but working with Perl-CGI is not something that we should discuss in this list since this is a *PHP* list. IMHO you should start reading some aspects of web development to make some things clear before start asking questions in the lsit. This will improve your understanding and it help us to make suggestions. I admire your calmness. Such a descriptive reply for someone who doesn't think before asking. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Email configuration
2009/2/5 Thodoris : > > I think that the OP mentioned the word fedora somewhere above... > Oh sorry, I'm so stupid... Anyways, if you want to send mail to large providers you'll need to use a relay. I found a nice tutorial about how to set it up with google apps. It was for Ubuntu but you just have to install msmtp and follow the other steps. Here it is: http://nanotux.com/blog/the-ultimate-server/4/#l-mail I did it on my little gentoo server here at home and it works great. -- Currently developing a browsergame... http://www.p-game.de Trade - Expand - Fight Follow me at twitter! http://twitter.com/moortier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] kadm5 Library
Sorry, I could have been a little clearer: I can't recompile PHP. It's against our general policy to use custom compiled software on the grounds that there are too many sysadmins managing a lot of these machines and if some software is custom compiled and others not, it gets too confusing when it comes to keeping the machines updated and patched. We're talking a dozen sysadmins and hundreds of machines here. :) That is understandable. No harm is done and sorry for the late reply. I did try to compile the PECL library by specifying the path to the Kerberos libraries as you suggested, but it turns out that the normal version of Kerberos seems to have, among other things, a "krb5/admin.h" header file, and the one that comes with CentOS has "krb5/krb5.h" instead, and even when I change the source code to use "krb5/krb5.h", it still throws about 50 errors talking about missing functions and re-defined functions and so on. Did you try to install krb5-devel. Try "yum search krb5" to see all the available packages that CentOS includes. In case your yum doesn't find something you may add more repos like Dag's: http://dag.wieers.com/ It is just an rpm that updates the systems repositories that I find very useful. I'm thinking that the problem is that the PECL module was designed to work with one version of the Kerberos library and CentOS provides a different version. I guess I was really asking if anyone had any diffs or anything I could apply to the PECL module to make it compile on a CentOS machine. Or perhaps is there a Yum repository somewhere that I could use to get a version of the PECL module precompiled for CentOS? I am not aware if there is a pre-compiled package for kerberos but Dag's repo doesn't provide it AFAIK. It does provide some other pecl extensions like php-pecl-fileinfo etc but not this one. What you need is to find a kerberos rpm to include development header in order to compile it your self. I should point out that the Perl Kerberos module did install and compile successfully on this machine, so I'm fairly sure that Kerberos is itself working. Tim Gustafson BSOE Webmaster UC Santa Cruz t...@soe.ucsc.edu 831-459-5354 Well let me tell what I did: I have installed this that is needed for the package to work: http://dag.wieers.com/rpm/packages/re2c/re2c-0.12.0-1.el5.rf.i386.rpm I have downloaded the source and tried to compile it with: ./configure --with-kadm5=/usr/include/krb5 But the compilation failed. My installed packages are: krb5-server-1.6.1-25.el5_2.2 krb5-libs-1.6.1-25.el5_2.2 krb5-workstation-1.6.1-25.el5_2.2 pam_krb5-2.2.14-1.el5_2.1 krb5-devel-1.6.1-25.el5_2.2 And then I run into this: http://pecl.php.net/bugs/bug.php?id=15196&thanks=3 I have already reported the bug and lets hope it will get fixed. -- Thodoris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Blank page of hell..what to look for
On Mon, Feb 2, 2009 at 12:51 PM, Jim Lucas wrote: > Terion Miller wrote: >> Is there a certain thing that should be suspected and looked at first when >> getting the php blank page of hell >> I have errors on and nothing is being output anywhere to lead me in the >> right direction, I have a VariableReveal script (one of you provide and >> THANK YOU IT HAS BEEN A LIFESAVER) But it is doing nothing today, yesterday >> the page worked today I get the blank page with not a clue in sight >> ARGH... >> Terion >> > > More then likely it is a parse error within the page. And no matter what > error reporting you have turned on "within" the script will effect the > outcome. > > You have two choices. Turn on error reporting from apache using the > httpd.conf file, in your php.ini file, or with a .htaccess file. > > This is the only way to get around parse errors without having error > reporting turned on globally. > > The other way is to cut/paste your code into sections. > > Cut out a large chunk of it, see if it works, if it does, paste it back in > and remove a smaller chunk, rinse/repeat until your find the error of your > ways... :) > > Better yet, use a IDE the does code highlighting. This would point you to > the problem rather quickly. > > -- > 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 > > Yes I have not had a single parse error in any of my files since I started using Eclipse (first phpeclipse but now PDT). It will even scan every single file in your current site (project) to make sure there's nothing wrong in them. It then puts a red icon inside the file explorer and also adds an entry into the problems tab. Very useful stuff. It also has real-time parse error detection to help you from making them in the first place. -- http://www.voom.me | EFnet: #voom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Blank page of hell..what to look for
Is there a certain thing that should be suspected and looked at first when getting the php blank page of hell I have errors on and nothing is being output anywhere to lead me in the right direction, I have a VariableReveal script (one of you provide and THANK YOU IT HAS BEEN A LIFESAVER) But it is doing nothing today, yesterday the page worked today I get the blank page with not a clue in sight ARGH... Terion First of all check if you are displaying error in your php.ini display_errors = On but don't use this in a normal site. You are probably already doing this because you mentioned that errors get displayed. You may use die to verify the how variables are changing values through the script and see if everything they store is what you want. die(print $var); die(print_r($array); die(var_dump($var)); You use it as you need to track down what is messing your script. Another way I can think you may use is exceptions especially if you are a PHP5 user. This could be useful: http://www.php.net/manual/en/language.exceptions.php I suspect that you would get a better answer if you were willing to send us some more details in what you are trying to do. -- Thodoris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cgi vs php
Y In cgi i can use perl ,c etc suppose i use perl now how efficiency differs? How cgi written in perl and php is differ in working in context of web service? other difference?. but their differ. On Thu, Feb 5, 2009 at 6:45 PM, Jay Blanchard wrote: [snip] can anybody tell me the benefits of php over cgi or vice versa? i need to compare both? [/snip] CGI is a gateway to be used by languages PHP is a language First of all try not to top post this is what we usually do here. Well CGI is a standard protocol implemented by many programming languages. You may start googling to find about it but this is a start: http://en.wikipedia.org/wiki/Common_Gateway_Interface Both Perl and PHP can work with CGI but working with Perl-CGI is not something that we should discuss in this list since this is a *PHP* list. IMHO you should start reading some aspects of web development to make some things clear before start asking questions in the lsit. This will improve your understanding and it help us to make suggestions. -- Thodoris
RE: [PHP] Is it possible to send POST vars through a header redirect?
At 2:52 AM -0700 2/5/09, TS wrote: I want my script to run and redirect with the var to another page without the user seeing it. Currently, I am using GET and header("Location: http://domain/?somevar=somevalue";) That would, by definition, allow the user to see it. If you want to pass a variable to another script, I know of four choices, namely: 1. Use POST; 2. Use GET; 3. Write the variable to a database; 4. Include the next script. HTH's 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] Email configuration
2009/2/5 It flance : Hi all, I've installed php and mysql in fedora. Now i am able to create php programs. But when I am unable to use email in my programs. I am wondering what is the easiest way to use email in my php programs. Can i send email from my personal computer. I am a regular person connected to internet through an internet provider. Is there any preconfigured software or I have to go through the configuration of sendmail for example? Thank you Sorry... But I need a _little_ bit more information. What operating system do you use? Linux/Windows/Mac/other? The main problem is that most of the big email providers don't accept mails from dialup connections, but there are solutions to work around this. For now start by telling me which operating system you have. I think that the OP mentioned the word fedora somewhere above... To the point: Your linux probably has already installed the sendmail suite. If that is the case (run rpm -qa | grep sendmail to check) you may safely use the PHP's mail function for simple things. In case you don't have sendmail installed use: # yum install sendmail http://www.php.net/manual/en/function.mail.php If you need more advanced features like for e.g. adding attachments to your e-mails you may consider other options like phpmailer. I have never used it myself but many people that belong in this gang are very fond of it. http://phpmailer.codeworxtech.com/ Keep in mind that in case you have compiled PHP from source without having the sendmail installed you may need to recompile it. You can find this by making a phpinfo somewhere. In case you have installed from package no harm is done. Put this in a script: You will find "sendmail_path" somethere in the resulting page or something like that "Path to sendmail". If this is set then everything will work like a charm. -- Thodoris
Re: [PHP] cgi vs php
Y In cgi i can use perl ,c etc suppose i use perl now how efficiency differs? How cgi written in perl and php is differ in working in context of web service? other difference?. but their differ. On Thu, Feb 5, 2009 at 6:45 PM, Jay Blanchard wrote: > [snip] > can anybody tell me the benefits of php over cgi or vice versa? > i need to compare both? > [/snip] > > CGI is a gateway to be used by languages > PHP is a language > -- vikas sharma
RE: [PHP] cgi vs php
[snip] can anybody tell me the benefits of php over cgi or vice versa? i need to compare both? [/snip] CGI is a gateway to be used by languages PHP is a language -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cgi vs php
can anybody tell me the benefits of php over cgi or vice versa? i need to compare both? -- vikas sharma
Re: [PHP] Clarity needed
tedd schreef: > Hi gang: > > I need some fog removed. does HARPP have anything for that? what about this? : http://www.postcard.org/fog.mp3 and the answer to you Q, like everyone else said: yup :-) PS - given you unlimited resources you might consider doing a charitable donation to FoxNews aficionados :-) > I have a problem where I have an unlimited number of tutors teaching an > unlimited number of courses. When I call upon a tutor, I want to see all > the courses they teach. > > In my old days, I would just set up a linked list of courses and attach > it to the tutor (another linked list). As a tutor adds courses, I would > just add the course to the end of the linked list. If the tutor deletes > a course, then I would remove it from the list by changing a single > pointer. If I needed a list of all the courses the tutor taught, I would > just run down the linked list pulling them out as needed. > > But now I have to think in terms of records in a database. I'll > eventually figure it out, but what are your suggestions/solutions? > > I understand that I can have one record set up for each tutor, and > another record set up for each course, and then tie the two together by > another record like an assignment. That way I can have as many > assignments as I want tying courses to tutors. > > It that the way you guys would do it? > > Thanks, > > tedd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Where does the sendmail() function come from?
> think I shouldve stayed > in bed today. I feel like that most days... -- Richard Heyes HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari: http://www.rgraph.org (Updated January 31st) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Email configuration
2009/2/5 It flance : > Hi all, > > I've installed php and mysql in fedora. Now i am able to create php programs. > But when I am unable to use email in my programs. I am wondering what is the > easiest way to use email in my php programs. Can i send email from my > personal computer. I am a regular person connected to internet through an > internet provider. > Is there any preconfigured software or I have to go through the configuration > of sendmail for example? > > Thank you Sorry... But I need a _little_ bit more information. What operating system do you use? Linux/Windows/Mac/other? The main problem is that most of the big email providers don't accept mails from dialup connections, but there are solutions to work around this. For now start by telling me which operating system you have. -- Currently developing a browsergame... http://www.p-game.de Trade - Expand - Fight Follow me at twitter! http://twitter.com/moortier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php