"Ricco F. Madsen" <ricco@net.dialog.dk> wrote in message
news:fc.0073fb6b0317b3410073fb6b0317b341.317b47c@net.dialog.dk...
> Hej NG,
>
> Hvad går galt i disse scripts? Når jeg afvikler dem, får jeg
> fejlmeddelelsen, at der er en forkert datatype til kaldet extract()...
>
> $result = mysql_query("select id, navn, date_format(tid, '%e/%c %Y,
> %H:%i') as time, besked from dagbog order by tid desc limit $start,
> $page_amount");
> $count = mysql_query("select count(*) as amount from dagbog");
>
> extract($count[0]);
Du checker ikke om dine querys overhovedet bliver udført, desuden kører du
extract på en mysql resultat-pointer(formentligt tallet 2)'s første
element..det giver ingen mening.
fra
http://dk.php.net/manual/en/function.mysql-query.php
mysql_query() returns TRUE (non-zero) or FALSE to indicate whether or not
the query succeeded. A return value of TRUE means that the query was legal
and could be executed by the server. It does not indicate anything about the
number of rows affected or returned. It is perfectly possible for a query to
succeed but affect no rows or return no rows.
Se evt. eksemplet på
http://dk.php.net/manual/en/function.mysql-fetch-assoc.php for hvordan man
henter info ud af en tabel.
--
Mvh. Nezar Nielsen
http://fez.dk/