|
Posted by Dave Nash on 01/08/07 01:05
Ive have implemented all of this code. works great on local server.
Ive moved to live server and get the following message.
Couldn't execute query.
Ive checked all config files.
cheers
Dave.
On 9 Dec 2006 13:28:36 -0800, "ZeldorBlat" <zeldorblat@gmail.com>
wrote:
>
>Dave Nash wrote:
>> Thanks Aho
>>
>> So how do I get the data from a db.
>> I have retrieved the category listings with this
>>
>> "SELECT * FROM categories" which gives me a page with the categories
>> and links to a a page called listitems.php
>>
>> What I cant work out is how to view all of the items once i click on a
>> category that match the category id in the relational table.
>>
>> thanks again.
>>
>>
>>
>>
>> On Sat, 09 Dec 2006 13:55:44 +0100, "J.O. Aho" <user@example.net>
>> wrote:
>>
>> >Dave Nash wrote:
>> >> hi All,
>> >>
>> >> I have created a database with two tables, categories and items.
>> >>
>> >> How do I go about assigning a particular item to more than one
>> >> category?
>> >>
>> >>
>> >> <Categories table>
>> >> Catid
>> >> Catname
>> >>
>> >> <Items table>
>> >> Itemid
>> >> itemname
>> >
>> >Create a relation table
>> >
>> ><ItemCat table>
>> >Itemid
>> >Catid
>> >
>> >
>> > //Aho
>
>Get all the items that belong to catid 5:
>
>select i.itemid, i.itemname
>from item i
> join ItemCat ic
> on i.itemid = ic.itemid
>where ic.catid = 5
[Back to original message]
|