hi,

thanks martin for your answer. I tried it, but it put me the names with
the the number.

array(6) {
  [0]=>
  array(4) {
    [0]=>
    string(10) "Aion Diary"
    ["name"]=>
    string(10) "Aion Diary"
    [1]=>
    string(1) "2"
    ["type"]=>
    string(1) "2"
  }
  ...
}

The thing is, that the type should not be "2", it should be "blog". Since
i want to output the code like:

foreach($all_waiting_sites as $waiting_site)
{
  echo '<li>'.$waiting_site['name'].' ('.$waiting_site['type'].')</li>';
}

This should be a list of sites, which are pending for site rating and
every site should have the site type written in the braces:

Testing Site (Blog)
Second Site (Game)

with best wishes

> Hi,
>
> this requires a simple join:
>
> select siterate.name,  sitetype.name
> from siterate
> join sitetype on sitetype.id = siterate.type
> where sitetype.status!=1
>
> This supposes that for every entry in siterate, there exists an entry in
> sitetypes with sitetype.id = siterate.type
>
> It seems to me that you might want to read up on SQL.
>
> Martin
>
> Artur Reilin schrieb:
>> I need help with my query.
>>
>> I have two tables:
>>
>> sitetypes(
>>   id integer primary key not null,
>>   name text
>> )
>>
>> siterate(
>>   id integer primary key not null,
>>   type integer not null,
>>   status integer not null,
>>   ...
>>   ...
>> )
>>
>> This is my currently query:
>> $all_waiting_sites = sqlite_array_query('select name,type from
>> '.$databasename.'siterate where status!=1 order by name',$db);
>>
>> And i like that my query, that makes the type integer from siterate into
>> the name text from sitetypes.
>>
>> Thanks forward for helping me.
>>
>> with best wishes
>>
>>
>> Artur Reilin
>> sqlite.yuedream.de
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>


Artur Reilin
sqlite.yuedream.de
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to