Re: [PHP] performance suggestions

2005-11-13 Thread Joe Belmaati
$sql = "SELECT u.*, s.*, p.*
FROM URL u, session s, page p
WHERE u.url_id = s.url_id
AND s.section_id = p.section";
if (!$result = mysql_query($sql))
{
 die('Could not obtain results');
}

while ($row = mysql_fetch_array($result))
{
 $url = $row['url_name'];
 ..
 ..
 and what ever else you want to do here;
}


"James Benson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thanks
>
>
>
>
> Richard Lynch wrote:
> > On Thu, November 3, 2005 8:29 am, James Benson wrote:
> >
> >>Dear group, can someone suggest the best way to do the following
> >>without
> >>writing some lengthy script that (possibly) could lead to performance
> >>issues,
> >>
> >>
> >>I have three DB fields in MySQL, each has a unique ID, I cannot think
> >>of
> >>any ways other than pulling each tables record then looping through to
> >>determine which one each belongs to which group then maybe placing
> >>into
> >>an array,
> >>the association between them all goes like this,
> >>
> >>
> >>URL:-
> >>url_id
> >>url_name
> >>
> >>section:-
> >>section_id
> >>url_id
> >>section_name
> >>
> >>page:-
> >>page_id
> >>section_id
> >>page_name
> >
> >
> > http://info.com/mysql+join
> >

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



Re: [PHP] performance suggestions

2005-11-08 Thread James Benson

Thanks




Richard Lynch wrote:

On Thu, November 3, 2005 8:29 am, James Benson wrote:


Dear group, can someone suggest the best way to do the following
without
writing some lengthy script that (possibly) could lead to performance
issues,


I have three DB fields in MySQL, each has a unique ID, I cannot think
of
any ways other than pulling each tables record then looping through to
determine which one each belongs to which group then maybe placing
into
an array,
the association between them all goes like this,


URL:-
url_id
url_name

section:-
section_id
url_id
section_name

page:-
page_id
section_id
page_name



http://info.com/mysql+join



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



Re: [PHP] performance suggestions

2005-11-08 Thread Richard Lynch
On Thu, November 3, 2005 8:29 am, James Benson wrote:
> Dear group, can someone suggest the best way to do the following
> without
> writing some lengthy script that (possibly) could lead to performance
> issues,
>
>
> I have three DB fields in MySQL, each has a unique ID, I cannot think
> of
> any ways other than pulling each tables record then looping through to
> determine which one each belongs to which group then maybe placing
> into
> an array,
> the association between them all goes like this,
>
>
> URL:-
> url_id
> url_name
>
> section:-
> section_id
> url_id
> section_name
>
> page:-
> page_id
> section_id
> page_name

http://info.com/mysql+join

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] performance suggestions

2005-11-03 Thread James Benson
Dear group, can someone suggest the best way to do the following without 
writing some lengthy script that (possibly) could lead to performance 
issues,



I have three DB fields in MySQL, each has a unique ID, I cannot think of 
any ways other than pulling each tables record then looping through to 
determine which one each belongs to which group then maybe placing into 
an array,

the association between them all goes like this,


URL:-
url_id
url_name

section:-
section_id
url_id
section_name

page:-
page_id
section_id
page_name



What I need to do is construct a navigation bar with each url, section 
then pages for that section, is their any quick ways (perhaps with SQL) 
anyone knows of,


A static array im currently using for this looks like:-

$nav = array(

1 => array('title' => "Homepage",
'url' => "/main::default"),

2 => array('title' => "About",
'url' => "/main::about",
'sub' => array(
array('title' => "Contact",
'url' => "/main::about::contact"),
)
),

);



Hope that makes sense to someone.



Thanks in advance for any suggestions/help


James



Apache: 1.3.33
PHP:4.4.1
MySQL:  4.1

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