[PHP-DB] Re: How are site layout blocks made
The blocks are made using templates which are "included" into the main page. The templates consist of both php code and html as well as CSS and sometimes javascript. Read the source code for one of the nukes and you will learn a lot about how they do it. Fred Barry Rumsey <[EMAIL PROTECTED]> wrote in message 019401c19bea$6c92d820$0100a8c0@weizmain">news:019401c19bea$6c92d820$0100a8c0@weizmain... I'll ask this question again but in a different way. In these php news portals like phpnuke, myphpnuke, they lay their site out in these so called blocks.I'm looking for information on how these blocks are made, are they done in php or html and where can I find more information on this. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] How are site layout blocks made
Barry, Just contain a table within another table and adjust the 'cellspadding' and 'cellspacing' and bgcolors to get the desired effect: I'm a table within another table! Pate this into an editor and play around with it. bal - Original Message - From: "Barry Rumsey" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 12, 2002 10:26 PM Subject: [PHP-DB] How are site layout blocks made I'll ask this question again but in a different way. In these php news portals like phpnuke, myphpnuke, they lay their site out in these so called blocks.I'm looking for information on how these blocks are made, are they done in php or html and where can I find more information on this. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] How are site layout blocks made
I'll ask this question again but in a different way. In these php news portals like phpnuke, myphpnuke, they lay their site out in these so called blocks.I'm looking for information on how these blocks are made, are they done in php or html and where can I find more information on this.
Re: [PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently
Howdy DL & Jason, I didn't see your response Jason until DL cc'd me this note. Sorry I didn't check back to follow-up on the newsgroup.. I thought I had the answer (well I had one, but not quite the right one).. Dl Neil wrote: > Sorry, I haven't been keeping close track of the list - fortunately you have solved your problem. Hey, you've responded better & faster than many [EMAIL PROTECTED] groups that I've delt with. > However you do not appear to have taken on-board Jason's comment. His/our concern would be that there are two > mechanisms for extracting the results of the query from the MySQL resultset: DBfetch_array() which is presumably > a local wrapper, and (later in the code) a 'native' call to mysql_fetch_array(). These two were both present > before the switch from WHILE to DO...WHILE. Well done for spotting the error! I had missed the wrapper when I was playing with the code.. I use a number of different PHP/MySQL interfaces and it is always a bit of a jump to remember how program X connects with MySQL (as the wrappers are all different).. > I too have built myself 'wrapper' routines to handle db queries and both the subsequent extraction and loop > control. They looks like: > Fetch( $dbConnection, $NumRows, etc, $ResultSet ) > while ( TheresAnotherRowToScan( $RowList, $ResultSet ) ) >{ etc > [in fact, I stole the arg lists from the routines themselves - the language used in the calling routines is much > more topical/self-documenting] I haven't and don't plan to develop my own wrappers. I'd much rather use ones like those developed for phplib.. > =Thus there is no need for the 'double' resultset extractions... Yes.. Not a good idea at the best of times.. Mike -- Mike Gifford, OpenConcept Consulting, http://www.openconcept.ca Supporting progressive organizations in online campaigns and tools. Feature: Women's Learning Partnership http://learningpartnership.org Truth is that which confirms what we already believe. Northrop Frye -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently
Howdy DL & Jason, I didn't see your response Jason until DL cc'd me this note. Sorry I didn't check back to follow-up on the newsgroup.. I thought I had the answer (well I had one, but not quite the right one).. Dl Neil wrote: > Sorry, I haven't been keeping close track of the list - fortunately you have solved >your problem. Hey, you've responded better & faster than many [EMAIL PROTECTED] groups that I've delt with. > However you do not appear to have taken on-board Jason's comment. His/our concern >would be that there are two > mechanisms for extracting the results of the query from the MySQL resultset: >DBfetch_array() which is presumably > a local wrapper, and (later in the code) a 'native' call to mysql_fetch_array(). >These two were both present > before the switch from WHILE to DO...WHILE. Well done for spotting the error! I had missed the wrapper when I was playing with the code.. I use a number of different PHP/MySQL interfaces and it is always a bit of a jump to remember how program X connects with MySQL (as the wrappers are all different).. > I too have built myself 'wrapper' routines to handle db queries and both the >subsequent extraction and loop > control. They looks like: > Fetch( $dbConnection, $NumRows, etc, $ResultSet ) > while ( TheresAnotherRowToScan( $RowList, $ResultSet ) ) >{ etc > [in fact, I stole the arg lists from the routines themselves - the language used in >the calling routines is much > more topical/self-documenting] I haven't and don't plan to develop my own wrappers. I'd much rather use ones like those developed for phplib.. > =Thus there is no need for the 'double' resultset extractions... Yes.. Not a good idea at the best of times.. Mike -- Mike Gifford, OpenConcept Consulting, http://www.openconcept.ca Supporting progressive organizations in online campaigns and tools. Feature: Women's Learning Partnership http://learningpartnership.org Truth is that which confirms what we already believe. Northrop Frye -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000
Hello, Boaz Yahav wrote: > > Well, > > My Site runs now on Solaris. Both the front end (Web Server / php code / > Apache) and the Database (Backend server). > We had some problems with Mysql and we don't find it 100% reliable for > such a busy site. We also want to use a db cluster > for high availability (we are talking about $200,000 of hardware and > software for the change). > > The code will still run on Apache / PHP / Solaris so there is no change > in that. Only the access to the Database will change. Well, I can't speak from experience, but I was told that MySQL replication is very good. For the amount of money that you have as budget, I am sure you can pay a lot of MySQL AB certified consulting hours. I don't know what you mean that MySQL is not reliable. Does that have to do with scalability? There is a whole set of smart decisions to make regarding scalability before you decide to waste you money on commercial solutions. Anyway, before you jump on throw a lot of money to it and expect to do it, I think you would like to read (if you haven't already) this very compeling article on how the AmIHotOrNot.com site developers made it so scalable with just LAMP (Linux-Apache-MySQL). One of the things he states is that it seems that MySQL is much more optimized for Open Source platforms such as Linux than for instance Sun. http://www.webtechniques.com/archives/2001/05/hong/ Maybe that is the way to go. If you make it that way, I would not mind getting half of your budget above for the advice. :-) Regards, Manuel Lemos -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000
Well, My Site runs now on Solaris. Both the front end (Web Server / php code / Apache) and the Database (Backend server). We had some problems with Mysql and we don't find it 100% reliable for such a busy site. We also want to use a db cluster for high availability (we are talking about $200,000 of hardware and software for the change). The code will still run on Apache / PHP / Solaris so there is no change in that. Only the access to the Database will change. Does this help? berber -Original Message- From: Manuel Lemos [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 12, 2002 10:28 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: Moving from MySQL to MSSQL Server 2000 Hello, Boaz Yahav wrote: > > Hi > > I'm planning to move my site (Very successful / high traffic Auctions > site) from MySQL to MSSQL Server 2000. > I was wondering if anyone has done this move and if there are any pit > falls to notice. > > 1. Is ODBC the only way to work from a Solaris / Apache / PHP 4 machine > to a Win2K / SQL Server 2000? > 2. What could be the performance cost (if any). > 3. Are there any special points that need to be taken into consideration > on either side? If you have these doubts I wonder if you are really sure if moving from OS and databases is the right thing to do. Maybe if you tell what is you motivation for the move we can address your real problems more objectively. Changing OS, Web Server and database server all at the same time sounds like an operation of great risk. If your motivation really justifies all the changes, maybe changing one thing at a time would be of less risk. Don't forget the Hotmail platform change fiasco. Regards, Manuel Lemos -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: Moving from MySQL to MSSQL Server 2000
Hello, Boaz Yahav wrote: > > Hi > > I'm planning to move my site (Very successful / high traffic Auctions > site) from MySQL to MSSQL Server 2000. > I was wondering if anyone has done this move and if there are any pit > falls to notice. > > 1. Is ODBC the only way to work from a Solaris / Apache / PHP 4 machine > to a Win2K / SQL Server 2000? > 2. What could be the performance cost (if any). > 3. Are there any special points that need to be taken into consideration > on either side? If you have these doubts I wonder if you are really sure if moving from OS and databases is the right thing to do. Maybe if you tell what is you motivation for the move we can address your real problems more objectively. Changing OS, Web Server and database server all at the same time sounds like an operation of great risk. If your motivation really justifies all the changes, maybe changing one thing at a time would be of less risk. Don't forget the Hotmail platform change fiasco. Regards, Manuel Lemos -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Moving from MySQL to MSSQL Server 2000
Hi I'm planning to move my site (Very successful / high traffic Auctions site) from MySQL to MSSQL Server 2000. I was wondering if anyone has done this move and if there are any pit falls to notice. 1. Is ODBC the only way to work from a Solaris / Apache / PHP 4 machine to a Win2K / SQL Server 2000? 2. What could be the performance cost (if any). 3. Are there any special points that need to be taken into consideration on either side? Thanks berber -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Create Table from a file in php
Dave, From the MySLQ manual : DROP TABLE [IF EXISTS] tbl_name [, tbl_name,...] [RESTRICT | CASCADE], but I don't know if it would work in a mysql_query(). Alternately, use mysql_tables() and mysql_tablename, and parse the results to determine if the table exists. If it does, use ALTER TABLE I guess. I've had the luxury of being able to do this at the console, not through a script. Not exactly nuggets, but hope it's helpful - Miles At 09:15 AM 1/12/2002 +, Dave Carrera wrote: >Miles >You got me thinking so of i went and produced this working block of code. > > >$sqlfile = "./i_inc/members.php"; // location of sql file > >$readsql =@fopen($sqlfile, "r") or die ("SQL file dosn't excist"); > >$sqlsql = fread($readsql,filesize($sqlfile)); > >mysql_query($sqlsql) or die ("members not created or already excists"); > >fclose($readsql); >?> > >This works perfectly but i have one thing i have been trying to solve for >the last two days. > >Some kind of if table excist loop is required. > >For the life of me i can't seem to get this info any where. > >5 Books, 20+ websites and no closer:-( > >Can you throw some nugets of wisdom this way. Please. > >Thanks for the help and i hope the included code sample can help someone >else. > >Thanks > >Dave C > >-Original Message- >From: Miles Thompson [mailto:[EMAIL PROTECTED]] >Sent: 11 January 2002 18:49 >To: Dave Carrera; [EMAIL PROTECTED] >Subject: Re: [PHP-DB] Create Table from a file in php > > >I don't know how you would do it from a file off the top of my head, so >let's invent it, in pseudocode, anyway. The important thing to remember is >that all of the commands to create or alter tables / databases are SQL >queries. So the mysql_query() function is used to do most of the work. > >Assumptions: >We have the database >We have a connection to it >We have the proper user/password for creation rights. >We have a file with the necessary SQL to create a tablle : CREATE TABLE >. etc., with no trailing semi-colon. > >pseudo code .. >Open the file & get the file handle >Read it all as one chunk, assigning it to a variable, say $sql. If the SQL >is broken into lines the file will have to be read and concatenated to the >variable. >Use the variable in a mysql_query, testing for success. >Issue a mysql_list_tables to see that you have the new tables, if that's >successful a list_fields for the new table. > >Refinements . things to check ... > >1. Maybe check for the existence of the table and drop it before you create >it. That can be done as a mysql_query. >2. You may need to add an opening double-quote and a closing double-quote >to what you are assigning to $sql. Offhand, I think not. > >Alternate approach, although you probably don't have the necessary >permission on the server would be to >exec( mysql database_name < file_containing_table_creation_code); > >I hope you find this helpful - Miles Thompson > > >At 10:57 AM 1/11/2002 +, Dave Carrera wrote: > >Hi All > > > >I want to create a table from a file that contains the sql to create the > >table. > > > >I have checked Mysql.com and have seen how to do it from telnet, but i want > >to do it from a php script. > > > >Can anyone please help. > > > >Thanks in Advance > > > >Dave C > > > >The two rules for success are: > >1. Never tell them everything you know. > > > > > > > >-- > >PHP Database Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] multiple tables insert
Barry, Hey, you're digging into it and making progress. You will end up with what you want, although it will seem like a long process. So you are welcome - Miles Thompson At 03:21 PM 1/12/2002 +1300, Barry Rumsey wrote: >I had been looking for a pre made script for a lyric site like phpnuke but >the only one I could find was myphplyrics which is quite hopeless ,so I've >had no choice but to try and make my own any way I would like to thank you >for all your help so far. > >B.J.Rumsey. >- Original Message - >From: "Miles Thompson" <[EMAIL PROTECTED]> >To: "Barry Rumsey" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> >Sent: Saturday, January 12, 2002 12:51 PM >Subject: Re: [PHP-DB] multiple tables insert > > > > Barry, > > > > Good question, and you have discovered one of MySQL's limitations, it does > > not enforce functional constraints. To put it another way, you can design > > parent-child relationships, but the db will never say "You can't add this > > because the parent record doesn't exist". So you have to do it in code, >not > > a big deal,and it's been done that way for years with other flat file, > > pseudo-relational database -- FoxPro, dBase, etc. > > > > You work around it by capturing the auto_increment value using the > > mysql_insert_id() function. Hence you can insert the values for the artist > > table, call mysql_insert_id() and assign it to a variable, say >$art_id_key, > > and use it in the insert for the album table. Then repeat, calling > > mysql_insert_id() and assigning it to $album_id_key after the insert into > > the album table so that you will have it for the insert into the tracks > > table. And so forth. > > > > You will be doing all these inserts on the same thread, so if someone else > > inserts into the same table you should be safe, according to the > > documentation. If A inserts into artist, B inserts into artist, then A > > calls mysql_insert_id() the value returned is for A's insert, not B's. > > MySQL has a separate thread for each of A and B. > > > > Now, don't trust me. Read up on the last_insert_id() and mysql_insert_id() > > functions in both the MySQL and PHP docs. > > > > I'll toss this out - what if you decide to capture other information, such > > as the name of the producer. Can your design handle that? What changes > > might you have to make to accommodate the change? > > > > Regards - Miles Thompson > > > > At 10:17 AM 1/12/2002 +1300, Barry Rumsey wrote: > > > Thanks for that. > > >But it has brought up another question. I'll list the tables so you'll >know > > >what i'm on about. > > >TABLE 1 : Album > > >alb_id int(11) NOT NULL auto_increment, > > > art_id int(11) NOT NULL default '0', > > > alb_name varchar(255) NOT NULL default '', > > > alb_image varchar(255) NOT NULL default '', > > > alb_year date NOT NULL default '-00-00', > > > alb_genre varchar(100) NOT NULL default '', > > > PRIMARY KEY (alb_id) > > > > > >TABLE 2 : Artist > > >art_id int(11) NOT NULL auto_increment, > > > art_name varchar(255) NOT NULL default '', > > > art_details mediumtext NOT NULL, > > > PRIMARY KEY (art_id) > > > > > >TABLE 3 : Songs > > >song_id int(11) NOT NULL auto_increment, > > > song_name varchar(255) NOT NULL default '', > > > song_lyrics mediumtext NOT NULL, > > > song_info mediumtext NOT NULL, > > > PRIMARY KEY (song_id) > > > > > >TABLE 4 : Tracks > > >track_id int(11) NOT NULL auto_increment, > > > alb_id int(11) NOT NULL default '0', > > > art_id int(11) NOT NULL default '0', > > > song_id int(11) NOT NULL default '0', > > > PRIMARY KEY (track_id) > > > > > >Ok I'll be able to work out the simple part of the inserts, but what >about > > >the auto_increment parts thatt relie on the information in the other >files. > > >eg: 'artist.art_id' should be the same as 'album.art_id' the problem is > > >that 'artist.art_id' is auto_increment and 'album.art_id' is not. So if >I > > >added an artist in the artist table and the auto_increment gave it the >value > > >of 5, how would I update the 'album.art_id' with the same value? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >- Original Message - > > >From: "Miles Thompson" <[EMAIL PROTECTED]> > > >To: "Barry Rumsey" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > > >Sent: Saturday, January 12, 2002 9:50 AM > > >Subject: Re: [PHP-DB] multiple tables insert > > > > > > > > > > Barry > > > > > > > > See below ... > > > > > > > > At 09:09 AM 1/12/2002 +1300, Barry Rumsey wrote: > > > > >Two questions: > > > > >1) If I have a url in the db that points to a image , how do I get >php to > > > > >get this image and display it ? > > > > > > > > Check the tag in an HTML reference > > > > > > > > > > > > >2) I have 4 tables in the db and would like to know of a good >tutorial on > > > > >inserting to multiple tables form a single form. > > > > > > > > There are many tutorials, the one I most frequently recommend is by >Julie > > > > Meloni
[PHP-DB] data access problem...
Hi again, I just solved the problem myself. It was a endless loop in one of the functions I use. Thanks anyway, Michael Hi, I have a quite strange problem with PHP/MySQL. I wrote some scripts for an user database and it's working fine so far. Today I implemented a script to change the details of a user. That's working as well. But after doing the update I can't access to the changed row anymore with that script. I checked the databse with PHPMyAdmin and the update was done correctly and I can even access it without problems. But not with my script. It isn't even possible to log in with that user any more. What could be a possible reason for that. If you need to see the code just tell me. I get no error messages but the timeout from the browser. TIA, Michael
Re: [PHP-DB] mail() - Return-Path
Malcolm, Thank you for all this info. Let's take it one step at a time:- > 1. Message sends. =yes, answers 1 and 4 highlight the problem with email (not just email from PHP!) - there are no guarantees... (except that the developer will suffer severe headaches and recurring nightmares) > 2/3. The code used is as per the annotated on line PHP manual > > [EMAIL PROTECTED] > 11-Jan-2002 02:10 > > There used to be a note with a complete set of headers to use with the mail > function but somehow now its gone so here they are again hope it helps :) > > $headers .= "From: Name<[EMAIL PROTECTED]>\n"; > $headers .= "X-Sender: <[EMAIL PROTECTED]>\n"; > $headers .= "X-Mailer: PHP\n"; //mailer > $headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal > $headers .= "Return-Path: <[EMAIL PROTECTED]>\n"; > //Uncomment this to send html format > //$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; > //$headers .= "cc: [EMAIL PROTECTED]\n"; // CC to > //$headers .= "bcc: [EMAIL PROTECTED]"; // BCCs to, separete > multiple with commas [EMAIL PROTECTED], [EMAIL PROTECTED] > > Regards > P.A. Luis Tena O. > Mexico city. =I struggled hard and long with this one too - even more so for us Windows users who have to worry about \n or \r\n... The bottom line is that the PHP-native email() function is very exacting/narrowly defined - and I couldn't get it to accept my code reliably (and there's nothing wrong with MY code so it must have been ... fault !?) > 4. No error messages. An email constructed as above sends perfectly - but > the return path defaults to the apache user (in my case www) not the > supplied return path. I tested the header construction by changing > Return-Path: to X-Path: and the X-Path: header appears correctly. I am not > sure but it seams that the real Return-Path is not overidable. =yes I found this too, but no I couldn't figure it out. =So let's try to be constructive: have you read the various RFCs (depending upon which formats of email... there are several to cope with)? RFC822 is the most basic/easiest for me to understand and covers simple-text email msgs (in particular the various headers). =This raises the question about the use/implementation of Return-Path vs From. If you remove the Return-Path header completely and succeed in send/receiving a msg, what happens when you hit Reply to that msg - does it give you the from address or does the (useless) Return-Path address interject? =Assuming that works ok, then the question becomes: do you really need to worry about Return-Path at all? If you do not control the Return-Path, you may want to ascertain the server admin's policy/procedure for dealing with any (your) 'returned mail'. =If you do need to get clever with the headers then be advised that my path to success ran through phpguru.org and a set of open source email PHP classes available there for download ('the man', Richard Heyes (?sp) is often here on the list steering us through email headaches). Even though I'm not into classes/OO-programming, several examples are provided and were enough to get me started - although much of the rationale is pure gobbledegook unless you've read the RFCs (nag, nag). =Sorry I didn't spot anything blindingly obvious. Let me know how you get on. =Regards, =dn > >> I Have been trying to change the Return-Path: when using mail() but to no > >> success. I have followed the examples in the documentation. Is there any > >> hidden trick - Iam using apache 1.3.14, php 4.1.1 and sendmail 8.9.3. > > > > > >=There's been some grouching on the lists about spam and vague questions - > How much detail have you given about > >this problem? Would it be acceptable to answer saying "Iam using apache > 1.3.14, php 4.1.1 and sendmail 8.9.3. > >and it works fine"? > > > >=Fortunately I don't (use sendmail) so after grumbling away, let me say > that I do have systems that email > >(successfully) from PHP code and am interested in the topic (and did like > your precise subject line). > > > >1 if a msg is constructed (without Return-Path) does it send/receive to spec? > >2 which example/documentation? > >3 what is the pertinent PHP code? > >4 what is the errmsg-received/other symptoms? > > > >=dn > > > > > > > >-- > >PHP Database Mailing List (http://www.php.net/) > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mail() - Return-Path
on 1/12/02 7:36 AM, Malcolm White at [EMAIL PROTECTED] appended the following bits to my mbox: > 4. No error messages. An email constructed as above sends perfectly - but > the return path defaults to the apache user (in my case www) not the > supplied return path. I tested the header construction by changing > Return-Path: to X-Path: and the X-Path: header appears correctly. I am not > sure but it seams that the real Return-Path is not overidable. It's a sendmail config thing. Do you have access to the server? Or is at a web host? If you can get access to your php.ini file and restart apache, you can change the sendmail path to: sendmail -t -i -f [EMAIL PROTECTED] That bounces all mail to that address. I believe that in PHP 4.0.6 they added another parameter of the mail function that lets you add options to sendmail from each script, but check the docs. HTH. Paul BTW, since your original message wasn't about databases and PHP, it should've gone to PHP-General. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] data access problem...
Hi, I have a quite strange problem with PHP/MySQL. I wrote some scripts for an user database and it's working fine so far. Today I implemented a script to change the details of a user. That's working as well. But after doing the update I can't access to the changed row anymore with that script. I checked the databse with PHPMyAdmin and the update was done correctly and I can even access it without problems. But not with my script. It isn't even possible to log in with that user any more. What could be a possible reason for that. If you need to see the code just tell me. I get no error messages but the timeout from the browser. TIA, Michael -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently
Mike, Sorry, I haven't been keeping close track of the list - fortunately you have solved your problem. However you do not appear to have taken on-board Jason's comment. His/our concern would be that there are two mechanisms for extracting the results of the query from the MySQL resultset: DBfetch_array() which is presumably a local wrapper, and (later in the code) a 'native' call to mysql_fetch_array(). These two were both present before the switch from WHILE to DO...WHILE. Well done for spotting the error! I too have built myself 'wrapper' routines to handle db queries and both the subsequent extraction and loop control. They looks like: Fetch( $dbConnection, $NumRows, etc, $ResultSet ) while ( TheresAnotherRowToScan( $RowList, $ResultSet ) ) { etc [in fact, I stole the arg lists from the routines themselves - the language used in the calling routines is much more topical/self-documenting] =Thus there is no need for the 'double' resultset extractions... =Regards, =dn - Original Message - From: "Mike Gifford" <[EMAIL PROTECTED]> To: "Mike Gifford" <[EMAIL PROTECTED]> Cc: "DL Neil" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: 11 January 2002 20:21 Subject: Re: [PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently > It may have been obvious to many, but I stumbled across the solution > (eventually).. > > Changing the while statement to a do statement did the trick: > > $sql = " SELECT COUNT(DateBilled) AS count, MONTH(DateBilled) AS > BilledMonth, YEAR(DateBilled) AS BilledYear FROM Invoices GROUP BY > MONTH(DateBilled) ORDER BY DateBilled DESC"; > $monthly_result = mysql_query($sql, $db); > $monthly_row = DBfetch_array($monthly_result); > $i=0; > do { > > $InvMonth[$i] = $monthly_row["BilledMonth"]; > $InvCount[$i] = $monthly_row["count"]; > echo "Month: " . date ("F", mktime(0,0,0,$InvMonth[$i],1,2002)) > . " Number of Invoices: " . $InvCount[$i] . > ""; > ++$i; > } while($monthly_row = mysql_fetch_array($monthly_result)); > > On Fri, 2002-01-11 at 11:20, Mike Gifford wrote: > > Hello, > > > > Thanks for your quick reply.. I'm trying to improve the stats feature > > for gcdb (a pretty decent little PHP/MySQL accounting package on SF.net) > > > > On Fri, 2002-01-11 at 05:24, DL Neil wrote: > > > Have you posted all of the relevant code - for example, how the 'result' is >limited to three month's worth of > > > data??? > > > > I didn't provide all of the code in the initial response as it was using > > a wrapper so I didn't know how relevant it would be.. However, your > > note made me realize that I could rewrite the code without the > > wrapper.. It still worked the same way. The code stands as: > > > > $sql = " SELECT COUNT(DateBilled) AS count, MONTH(DateBilled) AS > > BilledMonth, YEAR(DateBilled) AS BilledYear FROM Invoices GROUP BY > > MONTH(DateBilled) ORDER BY DateBilled DESC"; > > $monthly_result = mysql_query($sql, $db); > > $monthly_row = DBfetch_array($monthly_result); > > while($monthly_row = mysql_fetch_array($monthly_result)) { > > ++$i; > > $InvMonth[$i] = $monthly_row["BilledMonth"]; > > $InvCount[$i] = $monthly_row["count"]; > > echo "Month: " . date ("F", > > mktime(0,0,0,$InvMonth[$i],1,2002)) . " Number > > of Invoices: " . $InvCount[$i] . ""; > > } > > > > RESULTS: > > Month: December Number of Invoices: 22 > > Month: November Number of Invoices: 17 > > Month: October Number of Invoices: 21 > > > > > Have you extracted the SQL from the PHP and applied it directly to the command >line or used it in a MySQL > > > Management package? Was the result any different? > > > > Also a damn good idea (I haven't had root access to MySQL until > > recently, hadn't thought of that either) > > > > mysql> SELECT COUNT(DateBilled) AS count, MONTH(DateBilled) AS > > BilledMonth, YEAR(DateBilled) AS BilledYear FROM Invoices GROUP BY > > MONTH(DateBilled) ORDER BY DateBilled DESC; > > +---+-++ > > | count | BilledMonth | BilledYear | > > +---+-++ > > |15 | 1 | 2002 | > > |22 | 12 | 2001 | > > |17 | 11 | 2001 | > > |21 | 10 | 2001 | > > +---+-++ > > 4 rows in set (0.00 sec) > > > > Ok.. So the problem seems to be with my code.. > > > > > > $sql = " SELECT COUNT(DateBilled) AS count, MONTH(DateBilled) AS > > BilledMonth, YEAR(DateBilled) AS BilledYear FROM Invoices GROUP BY > > MONTH(DateBilled) ORDER BY DateBilled ASC"; > > $monthly_result = mysql_query($sql, $db); > > $monthly_row = DBfetch_array($monthly_result); > > $i=0; > > while($monthly_row = mysql_fetch_array($monthly_result)) { > > > > $InvMonth[$i] = $monthly_row["BilledMonth"]; > > $InvCount[$i] = $monthly_row["count"]; > > echo "Month: " . date ("F", mktime(0,0,0,$InvMonth[$i],1,2002)) > > . " Number of Invoices: " . $InvCount[$i] . > > ""; > > ++$i; > > } > > > > RESULTS: > > Month: November Number of Invoices: 17 > > Month: Decem
Re: [PHP-DB] mail() - Return-Path
1. Message sends. 2/3. The code used is as per the annotated on line PHP manual [EMAIL PROTECTED] 11-Jan-2002 02:10 There used to be a note with a complete set of headers to use with the mail function but somehow now its gone so here they are again hope it helps :) $headers .= "From: Name<[EMAIL PROTECTED]>\n"; $headers .= "X-Sender: <[EMAIL PROTECTED]>\n"; $headers .= "X-Mailer: PHP\n"; //mailer $headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal $headers .= "Return-Path: <[EMAIL PROTECTED]>\n"; //Uncomment this to send html format //$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; //$headers .= "cc: [EMAIL PROTECTED]\n"; // CC to //$headers .= "bcc: [EMAIL PROTECTED]"; // BCCs to, separete multiple with commas [EMAIL PROTECTED], [EMAIL PROTECTED] Regards P.A. Luis Tena O. Mexico city. 4. No error messages. An email constructed as above sends perfectly - but the return path defaults to the apache user (in my case www) not the supplied return path. I tested the header construction by changing Return-Path: to X-Path: and the X-Path: header appears correctly. I am not sure but it seams that the real Return-Path is not overidable. I hope this is clearer. Malcolm At 12:06 12/01/2002 -, you wrote: >Malcolm, > >> I Have been trying to change the Return-Path: when using mail() but to no >> success. I have followed the examples in the documentation. Is there any >> hidden trick - Iam using apache 1.3.14, php 4.1.1 and sendmail 8.9.3. > > >=There's been some grouching on the lists about spam and vague questions - How much detail have you given about >this problem? Would it be acceptable to answer saying "Iam using apache 1.3.14, php 4.1.1 and sendmail 8.9.3. >and it works fine"? > >=Fortunately I don't (use sendmail) so after grumbling away, let me say that I do have systems that email >(successfully) from PHP code and am interested in the topic (and did like your precise subject line). > >1 if a msg is constructed (without Return-Path) does it send/receive to spec? >2 which example/documentation? >3 what is the pertinent PHP code? >4 what is the errmsg-received/other symptoms? > >=dn > > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Sorting the output (opendir() and readdir())
Christian, > we have a directory with pics, that a user can associate with his data in a > form. we use opendir/readdir to show the directory contents. unfortunately, > this is not sorted. How can we achieve a listing in alphabetical order? > > this is our code: > > echo ""; > echo "please select"; > $fp = opendir("../pics/"); > while ($file = readdir($fp)) { > $selectfile="/pics/".$file; > if ($file=="." OR $file=="..") { } else { > $string_image .= " if ($selectfile==$image) { $string_image .= " SELECTED"; } > $string_image .= ">".$file.""; > } > } > echo $string_image; > echo ""; =readdir -- read entry from directory handle string readdir (resource dir_handle) Returns the filename of the next file from the directory. The filenames are not returned in any particular order. =so it is not possible to retrieve the filenames in alpha sequence. =Instead of taking the filenames directly from the readdir() and dropping them into the , it may be necessary to put them first into an array/list. At the end of the while loop, the array could be sorted, and then another (for) loop implemented to copy the sorted list from the sorted array/list into the s. =Regards, =dn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] mail() - Return-Path
Malcolm, > I Have been trying to change the Return-Path: when using mail() but to no > success. I have followed the examples in the documentation. Is there any > hidden trick - Iam using apache 1.3.14, php 4.1.1 and sendmail 8.9.3. =There's been some grouching on the lists about spam and vague questions - How much detail have you given about this problem? Would it be acceptable to answer saying "Iam using apache 1.3.14, php 4.1.1 and sendmail 8.9.3. and it works fine"? =Fortunately I don't (use sendmail) so after grumbling away, let me say that I do have systems that email (successfully) from PHP code and am interested in the topic (and did like your precise subject line). 1 if a msg is constructed (without Return-Path) does it send/receive to spec? 2 which example/documentation? 3 what is the pertinent PHP code? 4 what is the errmsg-received/other symptoms? =dn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Sorting the output (opendir() and readdir())
we have a directory with pics, that a user can associate with his data in a form. we use opendir/readdir to show the directory contents. unfortunately, this is not sorted. How can we achieve a listing in alphabetical order? this is our code: echo ""; echo "please select"; $fp = opendir("../pics/"); while ($file = readdir($fp)) { $selectfile="/pics/".$file; if ($file=="." OR $file=="..") { } else { $string_image .= ""; } } echo $string_image; echo ""; -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Fatal Error
i hav just upgraded from php3 to php4 i m getting this error through out my website what can be the problem... can anyone help me out Fatal error: Cannot instantiate non-existent class -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Oracle date conversion
> Thanks for your response. When I use SQL*Plus, I get full > date+time. I also get a full datetime from cx_Oracle (a > Python module). Is this then a default _PHP_ behavior when > querying an Oracle db? Why not return the full info? > Ordinarily, I would not complain about the small rewrite you > suggest, but my application is an SQL query window in the > browser, aimed at users who are not SQL enthusiasts. > Another option is to alter your NLS_DATE by setting it in init.ora (proabably not a good idea) or using "ALTER SESSION" which while not ideal would certainly stop you having to rewrite the query. As David pointed out though, using TO_CHAR and it's mate TO_DATE is by far the best way to go. Cheers, Graeme -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] mail() - Return-Path
I Have been trying to change the Return-Path: when using mail() but to no success. I have followed the examples in the documentation. Is there any hidden trick - Iam using apache 1.3.14, php 4.1.1 and sendmail 8.9.3. Thanks, Malcolm -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]