Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 08-25-2004, 11:30 PM id link not working
Junior Talker

Posts: 1
Trades: 0
When someone posts a topic on my forums and you click there username it goes to there profile by there ID but if someone replies and you go to click there username it is linking you to the first posters ID and going to there profile. I have used the same code as I have for my user list and topic area and they all work fine.
Example:

Poster1 - ?page=profiles&id=1
Post2 - ?page=profiles&id=1 but there ID should be 2

View:

http://www.effectivegaming.com/epane...rums&topicid=1
http://www.effectivegaming.com/epane...ums&topicid=10

Roll over the usernames and see how anyone who replies gets the same userid as the first poster.

Code:

PHP Code:
include("db.php");

$query="SELECT epanelforums_topics.*,epanelforums_posts.topic_id AS topic_id, epanelforums_posts.post_description AS post_description, epanelforums_posts.author AS fp_author, epanelforums_posts.date_time AS fp_date_time, epanelusers.id AS userid FROM epanelforums_topics, epanelforums_posts, epanelusers WHERE epanelforums_topics.author=epanelusers.username AND epanelforums_topics.id=\"$topicid\"";
$result=mysql_query($query);
$result2=mysql_query($query);
$row=mysql_fetch_array($result2);

$topicid=$row["id"];
$topic=$row["topic"];
$topic_description=$row["topic_description"];
$author=$row["author"];
$userid=$row["userid"];
$date_time=$row["date_time"];

echo 
"<font face=verdana size=1 color=#000000>
* Forums :: <a href=?page=forums>Main</a> - <a href=?page=forums&section=search>Search</a>
</font>
<p>
<table width=550 border=0 cellpadding=0>
<tr>
<td width=325 bgcolor=#f6f6f6 scope=col><div align=center><font face=verdana size=1 color=#000000><b>Topic</b></font></div></td>
<td width=100 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000><b>Author</b></font></td>
<td width=190 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000><b>Date & Time</b></font></td>
</tr>"
;

echo 
"<tr>
<td width=325 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000><b>
$topic</b></font></td>
<td width=100 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000><a href=?page=profiles&userid=
$userid>$author</a></font></td>
<td width=190 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000>date</font></td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td colspan=3 scope=col><font face=verdana size=1 color=#000000>
$topic_description</font></td>
</tr>
<tr>
</tr>
<tr>
</tr>"
;

while(
$row mysql_fetch_array($result)) {

$topicid=$row["id"];
$topic_id=$row["topic_id"];
$post_description=$row["post_description"];
$fp_author=$row["fp_author"];
$userid=$row["userid"];
$fp_date_time=$row["fp_date_time"];

if(
$topic_id == $topicid
{
echo 
"<tr>
<td width=325 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000> </font></td>
<td width=100 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000><a href=?page=profiles&userid=
$userid>$fp_author</a></font></td>
<td width=190 bgcolor=#f6f6f6 scope=col><font face=verdana size=1 color=#000000>date</font></td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td colspan=3 scope=col><font face=verdana size=1 color=#000000>
$post_description</font></td>
</tr>
<tr>
</tr>
<tr>
</tr>"

spGhe is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to id link not working
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19926 seconds with 12 queries