[PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Zouari Fourat
no one can help me outta here ? On Mon, 21 Mar 2005 01:58:10 +0100, Zouari Fourat [EMAIL PROTECTED] wrote: Hello, i made my own paginating class, it permit me to paginate over selected data and let me do good presentation (page 1, page 2 ...) i use adodb for db related functions, my

RE: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Bastien Koert
If its a big hit, are you sure that you have the proper indexes on the table. Another thing to consider is that if there is not a lot of activity on that table, you could place the total in a session object and revalidate that total every 10 queries or something to avoid querying the same

RE: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Patel, Aman
I've run in to this situation before. And it turns out that the extra pre-count query is not worth it. So the steps become: 1) Do your main query and fetch the results. 2) Use the count of results obtained in step 1. 3) Calculate pagination numbers. 4) Use array_slice to limit the results to a

RE: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Hatem
Fetching 10 rows is much faster than 1000 ! Fourat your code is optimized just keep it as it :) just keep your code away from adodb, pear db, and such abstraction if you want speed ! you don't need to talk about optimisation with 2 queries. Regards, Hatem --- Patel, Aman [EMAIL PROTECTED]

Re: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Martin Norland
Hatem wrote: Fetching 10 rows is much faster than 1000 ! Fourat your code is optimized just keep it as it :) just keep your code away from adodb, pear db, and such abstraction if you want speed ! you don't need to talk about optimisation with 2 queries. Regards, Hatem Depends on the DB, in many

Re: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Lester Caine
Martin Norland wrote: Hatem wrote: Fetching 10 rows is much faster than 1000 ! Fourat your code is optimized just keep it as it :) just keep your code away from adodb, pear db, and such abstraction if you want speed ! you don't need to talk about optimisation with 2 queries. Regards, Hatem Depends

Re: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Martin Norland
Lester Caine wrote: [snip] Don't know what you are using ;) Transferring 1000 records is always going to take time, when you only need 10 to be displayed. [snip] I wasn't referring to transferring the record, only running the query. [snip] Run the query without the limit, this gives you the count

Re: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Martin Norland
On a side note, who's sick of seeing the word optimizing misspelled in the title? :) Ah, the things we do to keep a thread clean. -- - Martin Norland, Sys Admin / Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent

Re: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread dpgirago
On a side note, who's sick of seeing the word optimizing misspelled in the title? :) Ah, the things we do to keep a thread clean. -- - Martin Norland, Sys Admin / Database / Web Developer, International Well, of course, _optimise_ is the British spelling of _optimize_ . Afterall, this

Re: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Martin Norland
[EMAIL PROTECTED] wrote: On a side note, who's sick of seeing the word optimizing misspelled in the title? :) Ah, the things we do to keep a thread clean. [snip] Well, of course, _optimise_ is the British spelling of _optimize_ . Afterall, this __is__ an international list ;- David My

[PHP-DB] Urgent DATA help needed

2005-03-22 Thread Chris Payne
Hi there everyone, My client suddenly dropped on me that they need to be able to search by date, IE: the past 1 day, 3 days, 5 days or 7 days. In the DB, the date format is: 2001-07-05 (For example) but I have no clue how to count the days in between to know how many days I am counting. Say

RE: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Hutchins, Richard
nonesense?? Sorry, couldn't resist, Martin. ;) This isn't a spelling bee anyway. I don't think it actually matters to anybody. I'll take solid programming advice with a few spelling errors over a shot in the dark with perfect spelling any day. -Original Message- From: Martin Norland

RE: [PHP-DB] Urgent DATA help needed

2005-03-22 Thread Hutchins, Richard
Can't you let the user tell you how many days back they want to count then just use that value in a query with the date calculation functions available in MySQL? You didn't specify your db type, but MySQL makes date calculations pretty easy. Check that out and see if it gives you something usable.

Re: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Martin Norland
Hutchins, Richard wrote: nonesense?? Sorry, couldn't resist, Martin. ;) This isn't a spelling bee anyway. I don't think it actually matters to anybody. I'll take solid programming advice with a few spelling errors over a shot in the dark with perfect spelling any day. Elbonian spelling.

Re: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread dpgirago
[EMAIL PROTECTED] wrote: On a side note, who's sick of seeing the word optimizing misspelled in the title? :) Ah, the things we do to keep a thread clean. [snip] Well, of course, _optimise_ is the British spelling of _optimize_ . Afterall, this __is__ an international list ;-

Re: [PHP-DB] Urgent DATA help needed

2005-03-22 Thread Aman Patel
Chris Payne wrote: Could anyone show me an example of how to do this? So to take 2001-07-05 and add 3 days to it? To use SQL to do this: SELECT FROM_DAYS((TO_DAYS('2001-07-05') + 3)); The TO_DAYS and FROM_DAYS are nice functions to use when you are fildling with dates as numbers (i.e. doing

Re: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Martin Norland
[EMAIL PROTECTED] wrote: [snip] My apologies to all, 'dict' tricked me - it has 'optimize', 'optimise', 'optimizing', but not 'optimising' - and I foolishly only checked the -ing conjugated tense instead of the root! (I do try a cursory check before posting such nonesense, honest!) Now back to

[PHP-DB] Content Management

2005-03-22 Thread Peter Westergaard
So I was looking at PHP products the other day, and I realized there are a few areas of web development in which I'm utterly ignorant. The most important, right now, is Content Management. (i.e. You design a site so that the client can manage it after you leave, even if they don't know HTML, and

[PHP-DB] Newbie: phpmyadmin and searching Unix Timestamps

2005-03-22 Thread Graham Anderson
is there an easy way to search through unixtimestamps ? like Select * from SessionTable Where ConvertToMonthFunction(unixTimeStamp) = 'March' ? be great to use the Variable function within phpmyAdmin many thanks g -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP-DB] Date problem again ;-)

2005-03-22 Thread Chris Payne
Hi there everyone, OK I'm using the following in my query to display entries in the LAST 3 days: DATE_SUB(CURDATE(),INTERVAL 3 DAY) = ListingDate But it doesn't seem to affect the results, the date format in my DB column (ListingDate - datatype is Date) is 2000-00-00 as in year, month

[PHP-DB] dbase and Debian

2005-03-22 Thread Ricardo Markiewicz
Hi all, today i found that debian has removed the php4-dbase package from unstable/testing due maintainer request. This has brought me some problems with many programs at work, so I decided to create my own PHP4 package with dbase support, using apt-build. This mail is to ask, if there is any

RE: [PHP-DB] Newbie: phpmyadmin and searching Unix Timestamps

2005-03-22 Thread Bastien Koert
SELECT date_format(FROM_UNIXTIME(875996580),'%Y-%m-%d'); is what I used yesterday to get around this problem bastien From: Graham Anderson [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] Newbie: phpmyadmin and searching Unix Timestamps Date: Tue, 22 Mar 2005 12:10:15 -0800 is there

Re: [PHP-DB] Newbie: phpmyadmin and searching Unix Timestamps

2005-03-22 Thread Aman Patel
Graham Anderson wrote: is there an easy way to search through unixtimestamps ? like Select * from SessionTable Where ConvertToMonthFunction(unixTimeStamp) = 'March' ? be great to use the Variable function within phpmyAdmin many thanks g On Mysql (works on 4.0 atleast), you can use the

Re: [PHP-DB] Re: paginating : optimising queries

2005-03-22 Thread Zouari Fourat
My apologies to all, i've mispelled that word, because in frensh we say optimisation/optimiser ... there's no snoop dog's in zat :) as about the subject, i think am no going to change my method and i'll use ADOdb for some reasons (performance alse) : * my application should be db

RE: [PHP-DB] Content Management

2005-03-22 Thread Hutchins, Richard
Peter, Unfortunately it's not a PHP solution, but I recently launched a site for a client and used the Macromedia Contribute product and Dreamweaver Templates to allow the user to maintain certain areas of the site. Now, before everybody else on the list blasts it, I'm not here touting

Re: [PHP-DB] Newbie: phpmyadmin and searching Unix Timestamps

2005-03-22 Thread Graham Anderson
So how would you build the query without knowing the unix TimeStamp as '527115' is the current date ? I am trying to build the query so it dynamically know what to look for like SELECT * FROM SessionTable WHERE MONTH(from_unixtime(all available records)) = 'March'; is something like

Re: [PHP-DB] Newbie: phpmyadmin and searching Unix Timestamps

2005-03-22 Thread Bastien Koert
SELECT * FROM SessionTable WHERE date_format((from_unixtime(fieldname),'%M') = 'March'; should do the trick bastien From: Graham Anderson [EMAIL PROTECTED] To: php-db@lists.php.net Subject: Re: [PHP-DB] Newbie: phpmyadmin and searching Unix Timestamps Date: Tue, 22 Mar 2005 15:06:35 -0800 So how

[PHP-DB] Timestamp question

2005-03-22 Thread Chris Payne
Hi there everyone, I have to convert dates in the following format to a valid unix timestamp to be stored in a mysql DB, how should I write it for this format? 12/03/04 (Day,month,year) I'm not sure how to format it correctly. I've tried to following but I don't think it's right:

Re: [PHP-DB] Date problem again ;-)

2005-03-22 Thread Forest Liu
I suppose there is a submit_time field in your DB table, so you could: SELECT * FROM `tablename` WHERE `submit_time`=.lastdays(3) lastdays() is a function you could create using mktime(),time(), and date() On Tue, 22 Mar 2005 16:28:39 -0500, Chris Payne [EMAIL PROTECTED] wrote: Hi there

RE: [PHP-DB] Re: Handling database calculations with a php page

2005-03-22 Thread JeRRy
Thankyou :) --- Bastien Koert [EMAIL PROTECTED] wrote: Yes, the 'a' value can also be a table alias name. Bastien From: JeRRy [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] Re: Handling database calculations with a php page Date: Mon, 14 Mar 2005 19:46:46 +1100 (EST)

[PHP-DB] MySQL 4.X Client Library

2005-03-22 Thread Arie Nugraha
I'm currently using MySQL 4 and php 4.3.10 right now but as you may already know that, mysql 4.X has new Client Library(it comes with new PASSWORD encryption method) and it is bundled with php and mysql itself. the problem is i cannot use that latest MySQL client Library, php still using the

[PHP-DB] database connection timeout

2005-03-22 Thread Juffermans, Jos
Hi, I'm trying to connect to an Oracle database (using ocilogon) which is in a different country and connected to our serverfarm via a VPN (the database has no public access). Unfortunately the VPN or the database is not always available. In those cases I will present the visitor with a page