[thelist] Rookie SQL Question... got it
Nan Harbison
nansmith at heritageconcord.org
Sun Aug 17 05:44:19 CDT 2003
>WHERE m_id = m_id
I think you have to specify which m_id is which
WHERE menu_items.m_id = menu_type.m_id
Nan
-----Original Message-----
<snip>
> $strSql = 'SELECT * ';
> $strSql .= ' FROM menu_items, menu_type ';
> $strSql .= ' WHERE m_id = m_id' ;
> $strSql .= ' WHERE menu_items.m_type = menu_type.m_type
';
> $strSql .= ' ORDER BY menu_items.m_type,
menu_items.m_sort ';
I made a rookie mistake!
Should read...
$strSql = 'SELECT * ';
$strSql .= ' FROM menu_items, menu_type ';
$strSql .= ' WHERE m_id = m_id' ;
$strSql .= ' AND menu_items.m_type = menu_type.m_type ';
$strSql .= ' ORDER BY menu_items.m_type,
menu_items.m_sort ';
That second WHERE in the fifth line. Should have been an
AND.
Thanks anyway.
Walter
More information about the thelist
mailing list