[PHP] Connection string and Monday Morning blues
Ug, I hate Mondays. stretches must drink more coffee./stretches Anyway, got a problem I hope someone can help with or at least jumpstart my brain. I wrote a few web pages, work fine on my machine. Uploaded them on Friday and they don't seem to work. Looks like I am not connecting to the database because every page I look at seems to end when it is suppose to connect. //** function ConnOpen($CheckForError) { @ $db = mysql_pconnect(webserver, username, password); if (!$db) { $CheckForError= Error: Could not connect to database. Ple ase try again later.; return $CheckForError; exit; } mysql_select_db(database); } //** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] url - self
hello, I have three tables with similar formats but different information. So, I wrote one function to deal with all three. Problem is that originally this was done with one form, so I had an add button at the bottom (and delete beside each record). But the form took too long to load now I need to break it up. I would like to keep the function and use it across three pages...I just need to know how to get the url of the page calling the function so I can delete the information from the appropriate table. Thanks in advance. Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] url - self
Yep, that is what I was looking for. thanks, paul Jon Haworth wrote: Hi Paul, I just need to know how to get the url of the page calling the function so I can delete the information from the appropriate table. Does $PHP_SELF not give you what you're after? Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] addslashes/stripslashes
thanks guys, got it working now. Removed Addslashes and it works fine. 1lt John W. Holmes wrote: I am trying to develop a search for my database. I used addslashes when entering the data, and then use addslashes with the search but nothing comes up: Select * from tblContacts, tblCountries WHERE (tblContacts.CountryCode=tblCountries.CountryID) AND (Organization LIKE '%o\'mallies%' ) I check in the database and o'mallies is indeed there as o\'mallies. And a search for just mallies works fine. If you see it in the database as o\'mallies, then you are running addslashes() twice on the data you are inserting. If you insert o\'mallies into the database, the \ is only there to tell the database that the following character is escaped. In this case, the ' is not the end of the string, but something that should be included in the data that's put into the database. The actual \ isn't put in the database. So, with that said, you can fix your code and find out where you are addslashes() twice. You can run some queries to replace \' in your database with ', too. Or you can just search for o\\\'mallies in your database, which will search for a literal \ and a literal ' in the data. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] addslashes/stripslashes
Hey, I am trying to develop a search for my database. I used addslashes when entering the data, and then use addslashes with the search but nothing comes up: Select * from tblContacts, tblCountries WHERE (tblContacts.CountryCode=tblCountries.CountryID) AND (Organization LIKE '%o\'mallies%' ) I check in the database and o'mallies is indeed there as o\'mallies. And a search for just mallies works fine. What gives? Thanks Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Scheduler, Staff Directory, Work tracker
Um yes, well the issue is not learning it is time. I am on an assignment here for only 4 more months and I have another project to do. There is no point in starting from scratch. I will check the web sites you suggested. Paul Justin French wrote: on 12/08/02 5:59 PM, Paul Dionne ([EMAIL PROTECTED]) wrote: Good morning everyone! Our organization is in need of a Scheduling program for meeting rooms. The program doesn't need to be very complicated...five or six rooms, outputs a list of rooms available for the time the user enters. We would put it on our intranet. see below We could also use a basic staff directory program: Outputs Name, Extension, email, position... maybe even a picture. We would put it on our web site. This is just a modification of a contact database. Nearly every PHP MySQL beginners tutorial starts with a simple contact database which you can modify to suit. I'd really advise actually learning a bit of this stuff, rather than grabbing something pre-built. End of the day, nothing will have *exactly* the features you need (now, or the future), and learning a little about the two languages will help you build the meeting room program, which no harder to build than the contact database. I think phpbuilder.net, sitepoint.com, phpbeginner.com and a few others are bound to have something you should use as a starting point. Lastly, we could use something to keep track of our workflow program otherwise referred to as a strategic plan. Workflow IS a more complex application. Have a look around at places like sourceforge.net for simular applications. Again, having a little bit of knowledge from your work with contact database and meeting room schedules will help you to modify these apps to suit. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Scheduler, Staff Directory, Work tracker
Good morning everyone! Our organization is in need of a Scheduling program for meeting rooms. The program doesn't need to be very complicated...five or six rooms, outputs a list of rooms available for the time the user enters. We would put it on our intranet. We could also use a basic staff directory program: Outputs Name, Extension, email, position... maybe even a picture. We would put it on our web site. Lastly, we could use something to keep track of our workflow program otherwise referred to as a strategic plan. Does anyone have some code laying around or know where I could find some. I see no need to recreate something that I am confident many organizations have. Thanks in advance, Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linux PHP editor
I am using Quanta 2.0 and loving it. http://quanta.sourceforge.net Oh My Gosh they have a new verison out.. 3.0 Time to upgrade. Paul @ Edwin wrote: I use vim most of the time... but how 'bout some bluefish? http://bluefish.openoffice.nl/ Or, try using your fav editor with wine... http://www.winehq.com/ (I wouldn't want to do that though...) - E How 'bout I just switched over to Red Hat Linux from Win2k... Only to find my fav editor only works on windows systems... could someone suggest a good replacement? -- JJ Harrison [EMAIL PROTECTED] www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ MSN ??? http://house.msn.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More ???s on passing variables
Jason Wong wrote: On Wednesday 31 July 2002 22:40, Paul Dionne wrote: I have a class in my script which has information on specific tables such as standard queries, tablenames, Index field... Then there is a function called StandardDropDown($ItemNum, $Name) which gets the info from the appropriate table you want and displays a dropdown menu based on the table. $ItemNum referrs to the table I want to output, $Name is what I want to call the dropdown in the HTML output. When I call the function directly from a page it works great. When I call it from another function I get an error: Fatal error: Call to a member function on a non-object in /var/www/html/COMESA/theme/functions.inc on line 61 This is line 61: $TableName= $ItemNum-get_TableName(); As I said, I only get this error when I call from a function, not if I call directly from a page. I don't see why that should make any difference though. In your function declare your object as global. I will do that and see if it helps, but why should that make a difference? I would like to know what I am doing wrong in general. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: More ???s on passing variables
Help still needed. I just went back to the code and looked. Making $ItemNum does not make a difference. And the object which is passed to it is part of the class which is global anyway. Paul Paul Dionne wrote: Hello everyone, I have a class in my script which has information on specific tables such as standard queries, tablenames, Index field... Then there is a function called StandardDropDown($ItemNum, $Name) which gets the info from the appropriate table you want and displays a dropdown menu based on the table. $ItemNum referrs to the table I want to output, $Name is what I want to call the dropdown in the HTML output. When I call the function directly from a page it works great. When I call it from another function I get an error: Fatal error: Call to a member function on a non-object in /var/www/html/COMESA/theme/functions.inc on line 61 This is line 61: $TableName= $ItemNum-get_TableName(); As I said, I only get this error when I call from a function, not if I call directly from a page. I don't see why that should make any difference though. Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: using Cascading style sheet
I am confident nearly all browsers support CSS. Only the oldest still lingering out there will not. But keep in mind your site is still readable if someone is still using an outdated browser. Advantages - many But the most important is consistency and centralization. You can change the look of your entire site by modifying one or two files. And it is much easier to have a novice come in and do basic edits to files. For example, I teach my clients who want to post articles of their own how to do bold, italic, underline, header1...6 then I just drop in the include files for header and footer and make any links and done. Paul Sailom wrote: I just turn to use CSS instead of HTML style. Can you explain pros and cons of using CSS? I am quite concern about compatibility to client-side web browser. Thanks Sailom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] More ???s on passing variables
Hello everyone, I have a class in my script which has information on specific tables such as standard queries, tablenames, Index field... Then there is a function called StandardDropDown($ItemNum, $Name) which gets the info from the appropriate table you want and displays a dropdown menu based on the table. $ItemNum referrs to the table I want to output, $Name is what I want to call the dropdown in the HTML output. When I call the function directly from a page it works great. When I call it from another function I get an error: Fatal error: Call to a member function on a non-object in /var/www/html/COMESA/theme/functions.inc on line 61 This is line 61: $TableName= $ItemNum-get_TableName(); As I said, I only get this error when I call from a function, not if I call directly from a page. I don't see why that should make any difference though. Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: ORDER BY from 2 tables
I am not sure what exactly you mean. If you are talking about a regular query then: SELECT tblTable1.hits, tblTable2.hits FROM tblTable1, tblTable2 ORDER BY tblTable1.hits; If you are talking about combining the two tables so that all your 'hits' are in one column then there are a few ways to skin that cute little kitten (in order of difficulty): 1) Check to see if your databae supports UNION clauses. 2) If not, make a table with the data from the first table then append the data from the second table. Then query for your combined results and delete the table from the database. You may run into problems if more than one person tries to do this at a time, so be careful. 3) Or. create an array using data from the first set then loop through the second set adding the data from the second set. Then sort. Good luck and keep us posted. Paul Georgie Casey wrote: i assume this is a simple question... how can I SELECT * FROM 2 different tables in the same query, ORDER BYing the 'hits' column, which both tables have. eg, 2 tables i have are similiar and i want to merge them and then select everything ordering by hits -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP counterpart to 4GuysFromRolla?
Is there a PHP counterpart to this site: http://www.4GuysFromRolla.com/ I always thought it was a great resource, easy to use, and full of information. I have not found anything nearly as comparable for PHP so far. Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: OO Programming - get practical
Thanks Richard, actually your comments really help. As I said to a few others who replied directly, I feel like it is something I ought to be doing. But most of my development is small-scale and I work alone. There is no external pressure to do so. Furthermore, I fear that if I were to use OO methods that someone who might no be so skilled would come in behind me and make a mess. Hey, it feels good to feel stupid...today is a good day grin. Paul Richard Lynch wrote: I want to point something out to aspiring authors. The truth is, that few books and web pages out there show examples using OO methods. For example, the book I use as my primary reference has one chapter on OO PHP and that is it. The rest of the examples in the book are in regular functions. And the one example they give is used to create a web page, with the Title , KeyWords, Styles, Header, Menu... as the objects. So, I guess my point is that if people want to encourage use of OO programming, they need to use more examples in their books instead of what is easy. Otherwise, if the reader doesn't get the one example, they don't have other examples to try. Furthermore, one cannot encourage people to think about how they can program using OO methods if they don't use such methods in their teaching of the subject matter. Basically, a Simple OO Example is an oxymoron, or a Bad Example (apologies to Ralph Covert). OO really only shows its strength when you have a certain set of pre-conditions: 1. Multiple programmers working on large-scale project -- OO safely sub-divides functionality so that they can code with less risk of screwing each other up. 2. Library release code (eg PHPLib) -- OO allows you to have minimal impact on the main application's variables/constants etc by providing a separate name-space 3. Real-World Object being modeled in complex/interesting ways -- OO provides a more natural coding style for this in some cases. None of these pre-conditions is met in a Simple Example That said, there are a zillion PHP OO applications/solutions out there for you to look at. Some even have comments. A few even have *GOOD* comments. :-) It is entirely possible, however, that you don't even *NEED* OO for anything you're doing. If your project doesn't meet any of the above three pre-conditions, chances are Really Good that OO would be like swatting a fly with a cannon. You can do it. And if a cannon is all you know how to work properly, maybe that's the best answer. But it's usually not the best answer in a general sense. NOTE: I'm an old-school Lisp hacker. I *LOVE* Object-Oriented systems. Yet I rarely feel a need for OO in my PHP scripts. YMMV. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OO Programming - get practical
Hey all, I want to point something out to aspiring authors. The truth is, that few books and web pages out there show examples using OO methods. For example, the book I use as my primary reference has one chapter on OO PHP and that is it. The rest of the examples in the book are in regular functions. And the one example they give is used to create a web page, with the Title , KeyWords, Styles, Header, Menu... as the objects. So, I guess my point is that if people want to encourage use of OO programming, they need to use more examples in their books instead of what is easy. Otherwise, if the reader doesn't get the one example, they don't have other examples to try. Furthermore, one cannot encourage people to think about how they can program using OO methods if they don't use such methods in their teaching of the subject matter. My 2 cents. Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multiple Tables -add, edit, delete
Thanks Dan Paul Analysis Solutions wrote: Oh, yes! I forgot about deleting countries that have been unchecked! Hmm... Lock the table to prevent people from reading from it, delete all records for that company, then loop through and insert the new data, then unlock the table. --Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multiple Tables -add, edit, delete
Hello all. Hope you are doing well. I would like some guidance here, meat of problem is in all caps: tblContacts -basic contact information on companies/non-government organizations/media outlets... tblCountriesOfOperation (tblContactsID, CountryID) -countries that tblContacts operate in. tblIndustrySectorsOfOperation (tblContactsID, IndustryID) - Industry sectors that tblContacts operate in. Would like a form to edit records. Problem: How do I display all the tblCountriesOfOperation for one tblContacts record SO THAT MULTIPLE COUNTRIES CAN BE ADDED OR DELETED FOR THAT RECORD? Same for tblIndustrySectorsOfOperation. I assume that I have to output the list of Countries of Operation in a loop then loop back through it after use has made changes to see what records have been changed. Or I guess I could present a dropdown of all remaining possible countries, after they click the data is refreshed and they are given the option of adding another country. Recommendations, sample code, general help all apreciated. thanks in advance, Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php