PhillNeedsHelp Posted April 16, 2008 Share Posted April 16, 2008 Ok.. I am trying to create a forum. This is the plan the user info in the left column (Displayed from the users table) And the forum post (from the forum table) I have a username which is sent to the post table which then selects the user info from the users table. The problem is when I enter multiple records... It doesn't show them! It will just show 1 record.. Anyone help please? Quote Link to comment Share on other sites More sharing options...
dazz_club Posted April 16, 2008 Share Posted April 16, 2008 Can we have a look at this script? Quote Link to comment Share on other sites More sharing options...
PhillNeedsHelp Posted April 16, 2008 Author Share Posted April 16, 2008 Hey thanks for reply Heres the two scripts: <?php $dbh=mysql_connect ("localhost", "usersl", "pass") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("phil_forum"); $query = "SELECT username, forum FROM forum WHERE question=$id"; $result = mysql_query ($query) or trigger_error("Query: $query\n<br />Mysql error: " . mysql_error()); while($row = mysql_fetch_array($result)) { $un = $row['user_name']; include('user-info.php'); } ?> That's the forum reply script.. Heres the user-info Code: <?php $dbh=mysql_connect ("localhost", "user", "pass") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("phil_useraccounts"); $query = "SELECT user_name, user_id, motto, badge, user_group FROM users WHERE user_name='$un'"; $result = mysql_query ($query) or trigger_error("Query: $query\n<br />Mysql error: " . mysql_error()); while($row = mysql_fetch_array($result)) { $user = $row['user']; echo '<img src="http://www.mysite.com?user=' .$user. '&action=&direction=2&head_direction=2&size=1&img_format=gif"><img } ?> Quote Link to comment Share on other sites More sharing options...
wmguk Posted April 16, 2008 Share Posted April 16, 2008 hey, I thought you had already posted this earlier today and were getting help? Quote Link to comment Share on other sites More sharing options...
PhillNeedsHelp Posted April 16, 2008 Author Share Posted April 16, 2008 Hey still hasn't fixed I thought if I re-word it then people may understand what i'm trying to do a little better... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.