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? Link to comment https://forums.phpfreaks.com/topic/101358-trying-to-create-a-forum/ 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? Link to comment https://forums.phpfreaks.com/topic/101358-trying-to-create-a-forum/#findComment-518424 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 } ?> Link to comment https://forums.phpfreaks.com/topic/101358-trying-to-create-a-forum/#findComment-518435 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? Link to comment https://forums.phpfreaks.com/topic/101358-trying-to-create-a-forum/#findComment-518442 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... Link to comment https://forums.phpfreaks.com/topic/101358-trying-to-create-a-forum/#findComment-518443 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.