Mailinglisten-Archive |
"Philip M. Meier" schrieb:
>
> Hallo Liste,
>
> ich habe ein grosses Problem mit folgendem MySQL-Query:
>
> $res = mysql_query("SELECT * FROM hwl_post,hwl_user WHERE hwl_post.user_id =
> hwl_user.user_id AND hwl_post.thread_id='$thread_id' ORDER BY post_id ASC
> LIMIT 15,29 ",$conn_id);
[...]
> $res = mysql_query("SELECT * FROM hwl_post,hwl_user WHERE hwl_post.user_id =
> hwl_user.user_id AND hwl_post.thread_id='$thread_id' ORDER BY post_id ASC
> LIMIT 0,14 ",$conn_id);
Beide Antworten sind wohl richtig.
LIMIT n gibt n Zeilen zurück
LIMIT m,n gibt ab m n Zeilen zurück
Daher muß dein Select
$res = mysql_query("SELECT * FROM hwl_post,hwl_user WHERE
hwl_post.user_id =
hwl_user.user_id AND hwl_post.thread_id='$thread_id' ORDER BY post_id
ASC
LIMIT 15,14 ",$conn_id);
^^^^
wohl so aussehen.
Hannes
--
php::bar PHP Wiki - Listenarchive