HTML/PHP/AJAX/JS - ID u?ytkownika zamiast nazwy
karzniczka - 20-11-2013, 16:44 Temat postu: ID użytkownika zamiast nazwy Witam potrzebuję pomocy z wyświetleniem nazwy użytkownika.
Taką zmienną próbowałem wyświetlić to pokazuje mi się samo ID.
Kod: | $topic_poster = $row['topic_poster']; |
Można liczyć na wszelaką pomoc ?
Woytec - 20-11-2013, 16:58
Jakie masz zapytanie?
karzniczka - 20-11-2013, 17:01
Kod: | $sql = 'SELECT p.topic_poster, p.topic_time, p.topic_id, p.topic_title, p.topic_last_post_id, a.user_id, a.username, a.user_level, a.user_jr, s.post_id, s.post_time, s.poster_id, s.forum_id, c.forum_id, c.forum_name, w.post_id, w.post_text
FROM ' . TOPICS_TABLE . ' p
LEFT JOIN ' . POSTS_TABLE . ' s ON (p.topic_last_post_id = s.post_id)
LEFT JOIN ' . USERS_TABLE . ' a ON (a.user_id = s.poster_id )
LEFT JOIN ' . USERS_TABLE . ' u ON (u.user_id = p.topic_poster)
LEFT JOIN ' . FORUMS_TABLE . ' c ON (c.forum_id = s.forum_id)
LEFT JOIN ' . POSTS_TEXT_TABLE . ' w ON (p.topic_last_post_id = w.post_id)
ORDER BY s.post_time DESC
LIMIT 5'; |
Woytec - 20-11-2013, 18:12
Kod: | $sql = 'SELECT p.topic_poster, p.topic_time, p.topic_id, p.topic_title, p.topic_last_post_id, a.user_id, a.username AS poster, a.user_level, a.user_jr, u.username AS topic_poster_name, s.post_id, s.post_time, s.poster_id, s.forum_id, c.forum_id, c.forum_name, w.post_id, w.post_text
FROM ' . TOPICS_TABLE . ' p
LEFT JOIN ' . POSTS_TABLE . ' s ON (p.topic_last_post_id = s.post_id)
LEFT JOIN ' . USERS_TABLE . ' a ON (a.user_id = s.poster_id )
LEFT JOIN ' . USERS_TABLE . ' u ON (u.user_id = p.topic_poster)
LEFT JOIN ' . FORUMS_TABLE . ' c ON (c.forum_id = s.forum_id)
LEFT JOIN ' . POSTS_TEXT_TABLE . ' w ON (p.topic_last_post_id = w.post_id)
ORDER BY s.post_time DESC
LIMIT 5'; |
Autor postu: poster, tematu: topic_poster_name.
karzniczka - 20-11-2013, 19:51
Woytec, pomożesz jeszcze z tego zrobić kolorowe nicki ??
|
|
|