[PHP-DB] ROWS
Dear Friends, Looking for php script, which can read number of rows in html file and display the same in browser, when contents of file are displayed Any guidance, please. Thank you
[PHP-DB] I have a CR-LF problem when pulling stuff out of my DB
This may not be exaxtly PHP-DB related but it is a result of screwing something up . I pulled a bunch of data from a DOS formatted tab seperated file and now I am dumping back out into a text file (on linux). So, as you can imagine, I ended up with a bunch of ^M throughout the file. I plan on fixing this. The solution is easy enough. I just need to remember to open the text files in vim and save as unix files. However, I now have an immediate need. I want to open these five files in vim and find and replace the ^M in every instance. I know how to find and replace (:g/find//s/replace/g). But I cannot get the ^M in the string. If I actually hit it reads as a return; if I type ^M using the shift-6 then it looks for the actual characters. Can anyone help? -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] I have a CR-LF problem when pulling stuff out of my DB
Actually, an easier tool to use is dos2unix, which is available on most Linux boxes. Just type dos2unix [filename], and you should be all set. - Russ Johnson Sabadell Spain -Mensaje original- De: Michael Cortes [mailto:[EMAIL PROTECTED] Enviado el: Thursday, August 19, 2004 1:36 PM Para: [EMAIL PROTECTED] Asunto: [PHP-DB] I have a CR-LF problem when pulling stuff out of my DB This may not be exaxtly PHP-DB related but it is a result of screwing something up . I pulled a bunch of data from a DOS formatted tab seperated file and now I am dumping back out into a text file (on linux). So, as you can imagine, I ended up with a bunch of ^M throughout the file. I plan on fixing this. The solution is easy enough. I just need to remember to open the text files in vim and save as unix files. However, I now have an immediate need. I want to open these five files in vim and find and replace the ^M in every instance. I know how to find and replace (:g/find//s/replace/g). But I cannot get the ^M in the string. If I actually hit it reads as a return; if I type ^M using the shift-6 then it looks for the actual characters. Can anyone help? -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- 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] I have a CR-LF problem when pulling stuff out of my DB
That didn't work. Here's why. This is not a dos file. It is a unix file but when dumping the data from my db, some fields had a trailing CR and LF. So what I ended up with was a ^M showing in the middle of a line when I open the file in vim. And... the lines will also end where they shouldn't. What is supposed to be one line, then continues on the next. While dos2unix did strip out the ^m, it left the LF (is it return or linefeed in unix) at the end of the line, starting a new one. I need to actually do a search on ^M followed by LF and replace it with nothing so I get my full line back. But I don't know how to enter in LF or CR in a vim search string. Hope this clarifies. On Thursday 19 August 2004 08:50 am, Russell Johnson wrote: > Actually, an easier tool to use is dos2unix, which is available on most > Linux boxes. Just type dos2unix [filename], and you should be all set. > > -Mensaje original- > De: Michael Cortes [mailto:[EMAIL PROTECTED] > Enviado el: Thursday, August 19, 2004 1:36 PM > Para: [EMAIL PROTECTED] > Asunto: [PHP-DB] I have a CR-LF problem when pulling stuff out of my DB > > However, I now have an immediate need. I want to open these five files in > vim and find and replace the ^M in every instance. I know how to find and > replace (:g/find//s/replace/g). But I cannot get the ^M in the string. If > I actually hit it reads as a return; if I type ^M using the > shift-6 then it looks for the actual characters. > > Can anyone help? > -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] I have a CR-LF problem when pulling stuff out of my DB
I found part of the answer.. when doing a search in vim you can hit ctrl-m as long as you hit ctrl-v first. ctrl-v tells vim to treat the following as a character, not to do the action i.e... carriage return. Now I need just one more piece, if anyone has the answer: ctrl-m is a carriage return. Does anyone know what ctrl seqence is line feed? Thanks On Thursday 19 August 2004 09:49 am, Michael Cortes wrote: > That didn't work. Here's why. This is not a dos file. It is a unix file > but when dumping the data from my db, some fields had a trailing CR and LF. > So what I ended up with was a ^M showing in the middle of a line when I > open the file in vim. And... the lines will also end where they shouldn't. > What is supposed to be one line, then continues on the next. > > While dos2unix did strip out the ^m, it left the LF (is it return or > linefeed in unix) at the end of the line, starting a new one. > > I need to actually do a search on ^M followed by LF and replace it with > nothing so I get my full line back. But I don't know how to enter in LF or > CR in a vim search string. > > Hope this clarifies. > -- Michael Cortes Fort LeBoeuf School District 34 East Ninth Street PO Box 810 Waterford PA 16441-0810 814.796.4795 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] IBM DB2
Hi Is anyone using PHP to connect to an IBM DB2 database? The reason why I am asking is becaouse I want to see if the odbtp extension can be used to successfully prepare and execute DB2 stored procedures. So far, ODBTP performs quite well with IBM DB2 in regards to regular queries. -- bob -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] I have a CR-LF problem when pulling stuff out of my DB
On 19 August 2004 17:02, Michael Cortes wrote: > ctrl-m is a carriage return. Does anyone know what ctrl seqence is > line feed? ctrl-j (CR and LF are ASCII codes 13 and 10, so ctrl+ the 13th and 10th letters of the alphabet respectively!) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, 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
Re: [PHP-DB] I have a CR-LF problem when pulling stuff out of my DB
Maybe I'm missing something...but why not do this with PHP (seeing as how this is a PHP list)? ereg_replace('(\r|\n)', ' ', $string) Just a thought On Thu, 19 Aug 2004 12:01:46 -0400, Michael Cortes <[EMAIL PROTECTED]> wrote: > I found part of the answer.. > > when doing a search in vim you can hit ctrl-m as long as you hit ctrl-v first. > ctrl-v tells vim to treat the following as a character, not to do the action > i.e... carriage return. > > Now I need just one more piece, if anyone has the answer: > > ctrl-m is a carriage return. Does anyone know what ctrl seqence is line feed? > > Thanks > > > > On Thursday 19 August 2004 09:49 am, Michael Cortes wrote: > > That didn't work. Here's why. This is not a dos file. It is a unix file > > but when dumping the data from my db, some fields had a trailing CR and LF. > > So what I ended up with was a ^M showing in the middle of a line when I > > open the file in vim. And... the lines will also end where they shouldn't. > > What is supposed to be one line, then continues on the next. > > > > While dos2unix did strip out the ^m, it left the LF (is it return or > > linefeed in unix) at the end of the line, starting a new one. > > > > I need to actually do a search on ^M followed by LF and replace it with > > nothing so I get my full line back. But I don't know how to enter in LF or > > CR in a vim search string. > > > > Hope this clarifies. > > > > -- > > Michael Cortes > Fort LeBoeuf School District > 34 East Ninth Street > PO Box 810 > Waterford PA 16441-0810 > 814.796.4795 > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- randy [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Postgresql Performance
Hi all, I have a problem with a small software in Postresql, through the time the database become slower and slower so, quick solution: pg_dump, dropdb, createdb and pg_dump again but this software is becoming important and such procedure is not a very reliable way to improve the performance, I have tried with some commands like Vacuum and Analyze but non of this seems to work as good as drop database and create again. Can any one give me some advices? Thanks Norma R -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Postgresql Performance
On Thu, 19 Aug 2004 18:12:16 -0500, Norma Ramirez <[EMAIL PROTECTED]> wrote: > Hi all, I have a problem with a small software in Postresql, through the > time the database become slower and slower so, quick solution: pg_dump, > dropdb, createdb and pg_dump again but this software is becoming important > and such procedure is not a very reliable way to improve the performance, I > have tried with some commands like Vacuum and Analyze but non of this seems > to work as good as drop database and create again. > > Can any one give me some advices? 1. vacuum and analyze would be my suggestions but you say you have tried that. 2. maybe upgrade your postgres version 3. try a postgres mailing list -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] IBM DB2
Robert Twitty wrote: Hi Is anyone using PHP to connect to an IBM DB2 database? The reason why I am asking is becaouse I want to see if the odbtp extension can be used to successfully prepare and execute DB2 stored procedures. So far, ODBTP performs quite well with IBM DB2 in regards to regular queries. I've never used stored procedures before, but if you have example code on hand, I can give it a shot... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB]different heading
pls. help me. i have made one webpage where user for getting a report checks the checkbox as per his requirement and accordinly only that data is retrieved from mysql. i used array and loop for getting the data. now my problem is that by default column name (of mysql table) is displayed as heading let me explain suppose the column name of mysql table is ==> Enter_Date, Opening_Units etc. etc. than date is displayed under Enter_Date and Opening_Units i want to use different heading than column_name (even if underscore sign (_) between Opening_Units is removed i will be happy) but keep in my mind that i have many columns. thanks for your help. balwant -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB]different heading
On Thursday 19 August 2004 18:28, balwantsingh wrote: > now my problem is that by default column name (of mysql table) is displayed > as heading You are in control of the HTML that goes into the webpage. You don't have to use the column names returned from the mysql query. So where's the problem? If you insist, you can use something like: SELECT clumsy_column_name AS goodname FROM ... Refer to MySQL documentation for more info. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db -- /* Left to themselves, things tend to go from bad to worse. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB]different heading
Or, you can just ereg_replace("_", " ", ""); On Fri, 20 Aug 2004 12:20:44 +0800, Jason Wong <[EMAIL PROTECTED]> wrote: > On Thursday 19 August 2004 18:28, balwantsingh wrote: > > > now my problem is that by default column name (of mysql table) is displayed > > as heading > > You are in control of the HTML that goes into the webpage. You don't have to > use the column names returned from the mysql query. So where's the problem? > > If you insist, you can use something like: > > SELECT clumsy_column_name AS goodname FROM ... > > Refer to MySQL documentation for more info. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > -- > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-db > -- > /* > Left to themselves, things tend to go from bad to worse. > */ > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- randy [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] I have a CR-LF problem when pulling stuff out of my DB
On Fri, 20 Aug 2004 01:31, Michael Cortes wrote: > I found part of the answer.. > > when doing a search in vim you can hit ctrl-m as long as you hit ctrl-v > first. ctrl-v tells vim to treat the following as a character, not to do > the action i.e... carriage return. > > Now I need just one more piece, if anyone has the answer: > > ctrl-m is a carriage return. Does anyone know what ctrl seqence is line > feed? > > Thanks Add these to your list of useful vim character codes: Ctrl-H = Backspace Ctrl-I = horizontal tab Ctrl-J = Line feed Ctrl-K = vertical tab Ctrl-L = form feed Cheers -- David Robley "Would you like to buy an alarm?" asked Tom self-righteously. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php