You are here: Re: How to use SQL "LIMIT" keyword against an MDB file « PHP Programming Language « IT news, forums, messages
Re: How to use SQL "LIMIT" keyword against an MDB file

Posted by Steve on 01/29/08 20:16

"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:y66dnRTY6-fDHgLanZ2dnUVZ_vDinZ2d@comcast.com...
> Steve wrote:
>> "Ivan Marsh" <annoyed@you.now> wrote in message
>> news:pan.2008.01.29.16.23.04.896088@you.now...
>>> On Mon, 28 Jan 2008 17:08:29 -0600, Steve wrote:
>>>
>>>
>>>> "Ivan Marsh" <annoyed@you.now> wrote in message
>>>> news:pan.2008.01.28.22.40.54.715306@you.now...
>>>>> On Mon, 28 Jan 2008 16:09:32 -0600, Steve wrote:
>>>>>
>>>>>
>>>>>> "Ivan Marsh" <annoyed@you.now> wrote in message
>>>>>> news:pan.2008.01.28.21.50.48.197643@you.now...
>>>>>>> On Mon, 28 Jan 2008 14:37:03 -0700, Martin wrote:
>>>>>>>
>>>>>>>> I'm trying to adapt a PHP script that was written to use MySQL, so
>>>>>>>> that it will work with an MSAccess MDB file.
>>>>>>>>
>>>>>>>> An important part of the script makes use of the SQL "LIMIT"
>>>>>>>> keyword
>>>>>>>> available in MySQL. eg: "SELECT MyField FROM MyTable LIMIT 40,10"
>>>>>>>> to
>>>>>>>> select 10 records beginning at the 41st record.
>>>>>>>>
>>>>>>>> Can anyone tell me how I can achieve this same functionality when
>>>>>>>> using ODBC functions to access an MDB file? I think I can set
>>>>>>>> ROWCOUNT (or possibly TOP) to retrieve only 10 records but how do I
>>>>>>>> get it to start at the 41st record?
>>>>>>> You just lost an enormous amount of functionality. I'm assuming this
>>>>>>> is something you had to do.
>>>>>>>
>>>>>>> Pull all of the records and then programatically strip out the
>>>>>>> records you don't want from the array.
>>>>>> are you out of your fucking mind?!!!
>>>>> I assure you I'm not... though I don't claim to be Mr. Grand Wizard
>>>>> PHP
>>>>> Programmer Guy.
>>>>>
>>>>>> yeah, let me pull all the records from my 55 million rowed table into
>>>>>> a php array...
>>>>> Can you fit 55 million rows in an Access database that's less than 2
>>>>> gigs?
>>>> let me assure you, if you pull even 2MB of data into an array just to
>>>> pseudo-query (i.e. removed unwanted data) then you're not using your
>>>> tools wisely. the only thing that should be returned from ANY db is
>>>> *just* the data you want...nothing more.
>>> Indeed. "All the records" in my above statement should be read "All the
>>> records needed" not "The entire dataset". The odbc_exec query should be
>>> used to produce the smallest dataset possible and then strip out the
>>> data
>>> not needed.
>>
>> hmmm, then you're still crazy. :)
>>
>> the db should be used to return *only* the data needed. there should be
>> nothing for you to have to strip out. what consitutues 'data needed' for
>> the op are only the records between x and n. getting all the records and
>> stripping out everything but x through n using php is ludicrous.
>
> Steve,
>
> That's great when the DB gives you the tools to do so. Unfortunately,
> Access is nowhere nearly as advanced as MySQL.

understood...no argument there. however, as i clarified with ivan, this is
not about access or mysql on that level. ivan suggests hacking away at a
returned dataset in php in query fashion. there simply is no reason to do so
in this case, and rarely in any other for that matter. access can certainly
be asked to provide x through n records without much fuss whatsoever. that's
what prompted the sarcastic comments initially.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация