[PHP-DB] case to comment, please
I have the following example case: 1- More than 1000 record in my MySQL database. 2- I have to submit those record via HTTP GET or POST method. 3- I have to read the confirmation message that will be printed on the remote page showing me that the vars have been inserted in the remote database. 4- of course, I have a limitation of executing time of 30 seconds and i should not modify the php.ini i did the following scenario : ?php function send_rec($var1 , $var2 ,$var3 ){ $handle = fopen(http://anotherwebserver/url2.php?var1=$var1$var2=$var2var3=$var3;, r) ; $data = fread($handle, 11); fclose($handle); if ($data == $var1) return true; else return false; } for ($i=0 ; $iNUM OF RECORDS ; $i++) { send_rec( $var1 , $var2 , $var3 ); } ? 1-the problem is that the 30 second of execution time expired before i can send even 200 records. 2- in case of not connection of the remote page, and i did not get the $var1 printed ($data == $var1) then i have to re submit this record. Regards -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] case to comment, please
Nabil wrote: 1-the problem is that the 30 second of execution time expired before i can send even 200 records. http://php.net/set_time_limit Personally I'd call set_time_limit once for each iteration of the loop with a sensible timeout like 30 seconds. Alternatively you can call it once at the start of the script with a timeout of 0 to let it run as long as it needs to. 2- in case of not connection of the remote page, and i did not get the $var1 printed ($data == $var1) then i have to re submit this record. The for loop doesn't make much sense since $var1/2/3 don't change with each iteration, but assuming $i is used to select the record to send something like this should do the trick... for ($i=0 ; $iNUM_OF_RECORDS ; $i++) { if (!send_rec( $var[$i][0] , $var[$i][1] , $var[$i][2] )) $i--; // Redo this record } I'd suggest you add something to ensure you don't retry the same record forever, but I'll leave that as an exercise for the reader :) -- Stuart -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Quick Question: Line Breaks
On 09 January 2004 03:58, Jacob Hackamack wrote: Hello, I have a couple of quick questions. When I execute this code on my php page (I know that the .PSD image isn¹t web ready, but Safari does what I need it to do :) ) it displays the entire source as one line. Is there anyway to have it be broken. I have read places (internet sites) that say that the following solutions might work: echo OE¹;\n\n echo OE¹\n\n ; echo OE\n\n¹; None of them seem to work, am I doing something wrong? echo 'meta http-equiv=content-type content=text/html; charset=utf-8'; echo 'html'; echo 'head'; echo 'title'; echo 'FilmCanister Desktops'; echo '/title'; echo '/head'; echo 'body'; echo 'center'; echo 'img src=images/Rotating.psd'; echo 'h2'; echo 'Coming SoonDesktop Pictures (2.83 GB Worth)/h2'; echo '/center'; echo '/body'; echo '/html'; The reason you have it all on one line is because you haven't echoed any newlines. You have a number of options to do this. As there is no variable interpolation anywhere in there, you could just break out of PHP and do it as straight HTML: ... ? meta http-equiv=content-type content=text/html; charset=utf-8 html head title FilmCanister Desktops /title /head body center img src=images/Rotating.psd h2 Coming SoonDesktop Pictures (2.83 GB Worth)/h2 /center /body /html ?php ... Or you could echo the whole thing in one go (since you can have newlines in a PHP string): echo 'meta http-equiv=content-type content=text/html; charset=utf-8 html head ... /body /html '; If you plan to have variables in there at some point, you can either use ?php echo $var ? segments, or use a heredoc: echo END meta http-equiv=content-type content=text/html; charset=utf-8 html head body center img src=images/$name.psd ... /body /html END; or, again, you could use a multi-line string -- but this time double-quoted to give interpolation (but note that you now have to escape all your embedded double quotes): echo meta http-equiv=\content-type\ content=\text/html; charset=utf-8\ html head body center img src=\images/$name.psd\ ... /body /html ; Which route you choose is pretty much personal taste -- personally, if I have a page that's mostly straight HTML with not much PHP code, I write it as HTML with embedded PHP snippets, but I know some people think that looks weird or ugly...! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Quick Question: Line Breaks
see 2 comments below Jacob Hackamack wrote: Hello, I have a couple of quick questions. When I execute this code on my php page (I know that the .PSD image isnt web ready, but Safari does what I need it to do :) ) it displays the entire source as one line. Is there anyway to have it be broken. I have read places (internet sites) that say that the following solutions might work: echo ;\n\n echo \n\n ; echo \n\n; None of them seem to work, am I doing something wrong? this lot is pure html, why are you using echo statements ? echo 'meta http-equiv=content-type content=text/html; charset=utf-8'; echo 'html'; echo 'head'; echo 'title'; echo 'FilmCanister Desktops'; echo '/title'; echo '/head'; echo 'body'; echo 'center'; echo 'img src=images/Rotating.psd'; echo 'h2'; echo 'Coming SoonDesktop Pictures (2.83 GB Worth)/h2'; echo '/center'; echo '/body'; echo '/html'; check out http://www.hotscripts.com/PHP/Scripts_and_Programs/Image_Galleries/index.html have fun .. Pete ;-) Also, I am looking for a good freeware image gallery for Linux/Apache, if anybody has any suggestions please help out. Thanks for advance. Jacob -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] csv export...?
Google is not my friend today... I have a reportng tool on a database i have, and I want to be able to exort the selected results (I've saved the SQL query as a session variable for ease of use) and save that data as a csv file... with headers if possible... Now I have found loadsa sites that let me upload a csv file, but not the other way around... Anyone care to help? * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. ***
Re: [PHP-DB] csv export...?
You didn't try to hard isn't it! :) If you want to save a file as csv just save the vars like this 1,2,3 4,5,6 ... 0,0,0 If you want to link a csv file for download put a href='file.csv'download/a. It's not so hard after all. :) Or I didn't get your message. Anyway, good luck! - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 09, 2004 17:35 Subject: [PHP-DB] csv export...? Google is not my friend today... I have a reportng tool on a database i have, and I want to be able to exort the selected results (I've saved the SQL query as a session variable for ease of use) and save that data as a csv file... with headers if possible... Now I have found loadsa sites that let me upload a csv file, but not the other way around... Anyone care to help? * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] csv export...?
Cheers for prompt reply... But.. what? I need to take an SQL query, and export teh results to a csv file... Are you really sure that simply pointing to a non existant csv file does that? I don't see it somehow...? I'm sorry if I'm wrong... Viorel Dragomir [EMAIL PROTECTED] 09/01/2004 15:50 To [EMAIL PROTECTED], [EMAIL PROTECTED] cc Subject Re: [PHP-DB] csv export...? You didn't try to hard isn't it! :) If you want to save a file as csv just save the vars like this 1,2,3 4,5,6 ... 0,0,0 If you want to link a csv file for download put a href='file.csv'download/a. It's not so hard after all. :) Or I didn't get your message. Anyway, good luck! - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 09, 2004 17:35 Subject: [PHP-DB] csv export...? Google is not my friend today... I have a reportng tool on a database i have, and I want to be able to exort the selected results (I've saved the SQL query as a session variable for ease of use) and save that data as a csv file... with headers if possible... Now I have found loadsa sites that let me upload a csv file, but not the other way around... Anyone care to help? * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. ***
Re: [PHP-DB] csv export...?
Tristan -- ...and then [EMAIL PROTECTED] said... % % Google is not my friend today... ... % Now I have found loadsa sites that let me upload a csv file, but not the % other way around... You might check PHPClasses to see if anyone has done this; I wouldn't be surprised. In general, though, you declare the file type and then run through a loop. From some code I have: header (Content-Type: application/csv;) ; # this is a CSV header (Content-disposition: attachment; filename=authorized-visitors.$d.csv) ; # file name ... [suck in file and dump into $a array] foreach ( array_keys($a) as $ak ) # walk thru the array { print \$a[$ak]\, ; }# print the field (yes, even if blank) print \n ;# end the row $total[$d]++ ; # keep count } # if($age||$ftime) // }}} } # if(is_file) } # while(readdir)// }}} % % Anyone care to help? There ya go :-) HTH HAND Happy New Year :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP-DB] csv export...?
It looks like is not so simple. But is not difficult at all.. Try to make something like: ?php header(Content-type: text/csv); $query = SELECT * FROM tables; $result = mysql_query($query); while($row = mysql_fetch_row($result)){ print implode(,, $row); } mysql_free_result($result); ? Check if functions like implode has the correct arguments. Anyway hopes it gives you a clue about what is going on. Don't forget to connect to database first of all. - Original Message - From: [EMAIL PROTECTED] To: Viorel Dragomir [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, January 09, 2004 17:52 Subject: Re: [PHP-DB] csv export...? Cheers for prompt reply... But.. what? I need to take an SQL query, and export teh results to a csv file... Are you really sure that simply pointing to a non existant csv file does that? I don't see it somehow...? I'm sorry if I'm wrong... Viorel Dragomir [EMAIL PROTECTED] 09/01/2004 15:50 To [EMAIL PROTECTED], [EMAIL PROTECTED] cc Subject Re: [PHP-DB] csv export...? You didn't try to hard isn't it! :) If you want to save a file as csv just save the vars like this 1,2,3 4,5,6 ... 0,0,0 If you want to link a csv file for download put a href='file.csv'download/a. It's not so hard after all. :) Or I didn't get your message. Anyway, good luck! - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 09, 2004 17:35 Subject: [PHP-DB] csv export...? Google is not my friend today... I have a reportng tool on a database i have, and I want to be able to exort the selected results (I've saved the SQL query as a session variable for ease of use) and save that data as a csv file... with headers if possible... Now I have found loadsa sites that let me upload a csv file, but not the other way around... Anyone care to help? * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] csv export...?
Viorel, et al -- ...and then Viorel Dragomir said... % % It looks like is not so simple. But is not difficult at all.. Right. % ... % while($row = mysql_fetch_row($result)){ % print implode(,, $row); I agree that implode is a better way to go. I had to have my fields export in a particular order when they were stored differently, so I loop through my format array to get the order of the keys to pull from the data array. HTH HAND HNY :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP-DB] csv export...?
Getting there... That did indeed output my results to the screen... Next steo is to output that same data to a new file... I've done downloads on my site elsewhere, using header(), but with existing files... I guess I need to learn how to use fwrite? Viorel Dragomir [EMAIL PROTECTED] 09/01/2004 16:09 To [EMAIL PROTECTED] cc [EMAIL PROTECTED] Subject Re: [PHP-DB] csv export...? It looks like is not so simple. But is not difficult at all.. Try to make something like: ?php header(Content-type: text/csv); $query = SELECT * FROM tables; $result = mysql_query($query); while($row = mysql_fetch_row($result)){ print implode(,, $row); } mysql_free_result($result); ? Check if functions like implode has the correct arguments. Anyway hopes it gives you a clue about what is going on. Don't forget to connect to database first of all. - Original Message - From: [EMAIL PROTECTED] To: Viorel Dragomir [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, January 09, 2004 17:52 Subject: Re: [PHP-DB] csv export...? Cheers for prompt reply... But.. what? I need to take an SQL query, and export teh results to a csv file... Are you really sure that simply pointing to a non existant csv file does that? I don't see it somehow...? I'm sorry if I'm wrong... Viorel Dragomir [EMAIL PROTECTED] 09/01/2004 15:50 To [EMAIL PROTECTED], [EMAIL PROTECTED] cc Subject Re: [PHP-DB] csv export...? You didn't try to hard isn't it! :) If you want to save a file as csv just save the vars like this 1,2,3 4,5,6 ... 0,0,0 If you want to link a csv file for download put a href='file.csv'download/a. It's not so hard after all. :) Or I didn't get your message. Anyway, good luck! - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 09, 2004 17:35 Subject: [PHP-DB] csv export...? Google is not my friend today... I have a reportng tool on a database i have, and I want to be able to exort the selected results (I've saved the SQL query as a session variable for ease of use) and save that data as a csv file... with headers if possible... Now I have found loadsa sites that let me upload a csv file, but not the other way around... Anyone care to help? * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. ***
Re: [PHP-DB] csv export...?
Tristan -- ...and then [EMAIL PROTECTED] said... % % Getting there... % That did indeed output my results to the screen... Yay! % Next steo is to output that same data to a new file... A file on the surfer's computer or a file on your server? % % I've done downloads on my site elsewhere, using header(), but with % existing files... % I guess I need to learn how to use fwrite? Only if you plan to store the result file on your server, and since you have the DB there I don't see why you would. HTH HAND HNY :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP-DB] csv export...?
On the users computer... When my bosses look at the reporting tool I built. They are gonna hit the export link, and get directed to a page that let's them save the data as a csv file, for use in excel. That's the code I'm working on here today... ho hum... is it the weekend yet ;-) David T-G [EMAIL PROTECTED] 09/01/2004 16:33 To PHP DB list [EMAIL PROTECTED] cc [EMAIL PROTECTED] Subject Re: [PHP-DB] csv export...? Tristan -- ...and then [EMAIL PROTECTED] said... % % Getting there... % That did indeed output my results to the screen... Yay! % Next steo is to output that same data to a new file... A file on the surfer's computer or a file on your server? % % I've done downloads on my site elsewhere, using header(), but with % existing files... % I guess I need to learn how to use fwrite? Only if you plan to store the result file on your server, and since you have the DB there I don't see why you would. HTH HAND HNY :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] csv export...?
Tristan -- ...and then [EMAIL PROTECTED] said... % % On the users computer... OK; that's what I figured. % When my bosses look at the reporting tool I built. % They are gonna hit the export link, and get directed to a page that let's % them save the data as a csv file, for use in excel. Yep. % That's the code I'm working on here today... Look at the header() lines in my reply outside of this subthread. % % ho hum... is it the weekend yet ;-) Not quite, but you're closer :-) HTH HAND HNY :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP-DB] csv export...?
Google works!!! just found this, and it works: On the other side it may be better and easier to create a csv file on the fly. Create a page, say csv-export.php, and link to it using a href="" This way the user's browser is tricked that the link points to a CSV file, if it does not honor the content-type it sends (see below). David T-G [EMAIL PROTECTED] 09/01/2004 16:42 To PHP DB list [EMAIL PROTECTED] cc [EMAIL PROTECTED] Subject Re: [PHP-DB] csv export...? Tristan -- ...and then [EMAIL PROTECTED] said... % % On the users computer... OK; that's what I figured. % When my bosses look at the reporting tool I built. % They are gonna hit the export link, and get directed to a page that let's % them save the data as a csv file, for use in excel. Yep. % That's the code I'm working on here today... Look at the header() lines in my reply outside of this subthread. % % ho hum... is it the weekend yet ;-) Not quite, but you're closer :-) HTH HAND HNY :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Need help replacing one record
Is there a way to change the information in one record of a database, for example the password, without having to open the entire row, delete it, and then add it with $row_data[name] and all and the $newpass as changed password? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Need help replacing one record
$result=mysql_query(UPDATE tablename SET userpwd='$newpass' WHERE username='$name'); -Original Message- From: Jeroen Wasteels [mailto:[EMAIL PROTECTED] Sent: sexta-feira, 9 de Janeiro de 2004 18:24 To: [EMAIL PROTECTED] Subject: [PHP-DB] Need help replacing one record Is there a way to change the information in one record of a database, for example the password, without having to open the entire row, delete it, and then add it with $row_data[name] and all and the $newpass as changed password? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Need help replacing one record
If I understand your question correctly, an UPDATE query should be all you need. UPDATE tablename SET columname='value' WHERE someid='somenum'; I'm assuming you don't have the MySQL doc. Check mysql.com for the docs for your version of the server. Rich Hutchins, CIW Professional Sr. Technical Writing Administrator Getinge USA 1777 E. Henrietta Rd. Rochester NY 14623 585-272-5072 www.getingeusa.com -Original Message- From: Jeroen Wasteels [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:24 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Need help replacing one record Is there a way to change the information in one record of a database, for example the password, without having to open the entire row, delete it, and then add it with $row_data[name] and all and the $newpass as changed password? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] OK, I'm stumped
Here's my dilemma: 2 tables and 2 others that have current data in them. The 2 tables that have the current data in them I know how to display, the problem I am having is the 2 tables I need to transfer information to have to have the same key in one location Tables: CREATE TABLE `store_orders` ( `id` int(11) NOT NULL auto_increment, `order_date` datetime default NULL, `order_name` varchar(100) default NULL, `order_address` varchar(255) default NULL, `order_city` varchar(50) default NULL, `order_state` char(2) default NULL, `order_zip` varchar(10) default NULL, `order_tel` varchar(25) default NULL, `order_email` varchar(100) default NULL, `item_total` float(6,2) default NULL, `shipping_total` float(6,2) default NULL, `authorization` varchar(50) default NULL, `status` enum('proceed','pending') default NULL, PRIMARY KEY (`id`) ) TYPE=MyISAM; -- -- Table structure for table `store_orders_itemmap` -- CREATE TABLE `store_orders_itemmap` ( `id` int(11) NOT NULL auto_increment, `order_id` int(11) default NULL, `sel_item_id` int(11) default NULL, `sel_item_qty` smallint(6) default NULL, `sel_item_price` float(6,2) default NULL, PRIMARY KEY (`id`) ) TYPE=MyISAM; The 'id' of the 'store_orders' table HAS to be entered into 'order_id' of the 'store_order_itemmap'. I am having the problem because I can't figure out how to logically make that happen in 1 step, moving everything from the 2 tables they are currently in (a temp table of the customer information a temp table of the order'. I use the session ID to track the temporary stuff, but once they commit it to an order I need a different number. They are allowed to make multiple orders on the session ID and changing a session ID is not working for me (destroy and start on the session do nothing). HELP! TIA!! Robert ~~~ Genius does what it must, and talent does what it can. -Owen Meredith. ~~~ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Seeking Opinions about PHP Directory Organization and Permissions on Linux
Howdy all, I have been using PHP, MySQL and Apache on Win2K for about a year now and have recently begun the process of switching development to Linux -- RH9.0. Yesterday (by using the excellent reference by Patrick Harper, http://www.internetsecurityguru.com/documents/snort_acid_rh9.pdf ) I finally successfully installed from source MySQL-4.0.16, PHP-4.3.4, and Apache-2.0.48 on Linux, and a test phpinfo() page worked as expected. Now I need to migrate several multi-file (db_connect files, function include files, C executables) apps from windows to linux, so I was wondering: 1. How *nix users organize their 'include' and 'session' directories (e.g., outside the web root? how deep in the directory structure?). 2. Whether all files (including C executables) should be owned by root, and what permissions should be set. For example, I was logged in as root when I made the phpinfo() file, so it _is_ owned by root. Permissions were set automatically to 0644. Is this customary? And who/what will own the session files as they are created? Perhaps I'm over-thinking these issues, but I've not much experience on *nix compared to windows, and it's Friday afternoon in my spot of the world. Thanks in advance for any suggestions / tips, etc... dave
[PHP-DB] Re: Seeking Opinions about PHP Directory Organization and Permissions on Linux
[EMAIL PROTECTED] wrote: Howdy all, I have been using PHP, MySQL and Apache on Win2K for about a year now and have recently begun the process of switching development to Linux -- RH9.0. Yesterday (by using the excellent reference by Patrick Harper, http://www.internetsecurityguru.com/documents/snort_acid_rh9.pdf ) I finally successfully installed from source MySQL-4.0.16, PHP-4.3.4, and Apache-2.0.48 on Linux, and a test phpinfo() page worked as expected. Now I need to migrate several multi-file (db_connect files, function include files, C executables) apps from windows to linux, so I was wondering: 1. How *nix users organize their 'include' and 'session' directories Hm i've got me sessions in /tmp/... (e.g., outside the web root? how deep in the directory structure?). 2. Whether all files (including C executables) should be owned by root, and what permissions should be set. For example, I was logged in as root when I made the phpinfo() file, so it _is_ owned by root. Permissions were set automatically to 0644. Is this customary? And who/what will own the session files as they are created? I think the session files were owns by the user who is running the Webserver.. and sry for my bad english :( Greetings, Jonas Perhaps I'm over-thinking these issues, but I've not much experience on *nix compared to windows, and it's Friday afternoon in my spot of the world. Thanks in advance for any suggestions / tips, etc... dave -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php