Re: Re: dynamically naming PHP vars on the fly?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



of course u can do this by sql.

see this
SELECT *
FROM `sometable`
LIMIT 0 , 30

gives u max 30 records if existstarting at record 0

on the next request u could say
SELECT *
FROM `sometable`
LIMIT 30 , 30

giving u max 30 recotds starting at record 30

ralph
ralph_deffke@xxxxxxxx

"Nisse Engström" <news.NOSPAM.0ixbtqKe@xxxxxxxx> wrote in message
news:EB.35.03345.5F47D7A4@xxxxxxxxxxxxxxx
> On Thu, 6 Aug 2009 12:42:49 -0600, Govinda wrote:
>
> >> Others have mentioned variable variables. While I have
> >> used those, I tend to prefer arrays:
> >
> > ah, yes, I see that too, now.  Thanks for reminding me about arrays.
> >   (You must be quite adept at arrays. )
>
> I don't know, but I often stuff things into array,
> such as the following snippet:
>
> ...   while ($r = mysql_fetch_row ($res)) {
>         $news_paged[$page][$r[0]]['short_desc'] = $r[1];
>         if (isset ($r[2]))
>           $news_paged[$page][$r[0]]['long_desc'] = $r[2];
> ...
>
>
> I wonder if there's a noticable difference in performance
> between variable variables and arrays... I'm guessing it's
> small enough to be of no concern.
>
> > (And to give you credit Nisse, I ended up going with your solution
> > ('knock on wood'.. it is not all done yet) from the other php-db list
> > (building an array from data returned from the 3 union all selects-
> > query).)
>
> I'm a total newbie when it comes to SQL beyond simple SELECTs.
> If there's a noticable gain to be made from limiting the number
> of rows returned from the database, then that is probably worth
> persuing. Otherwise, I'd do it in PHP.
>
>
> /Nisse



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux