Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8881049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:16:13+00:00 2026-06-14T20:16:13+00:00

i have 2 files fourm.php and viewfourm.php fourm.php first <?php $host=mysql13.000webhost.com; // Host name

  • 0

i have 2 files fourm.php and viewfourm.php

fourm.php first

<?php

$host="mysql13.000webhost.com"; // Host name 
$username="a2670376_Users"; // Mysql username 
$password="PASS"; // Mysql password 
$db_name="a2670376_Pass"; // Database name 
$tbl_name="fourm"; // Table name 

  // Connect to server and select database.
 mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
 mysql_select_db("$db_name")or die("cannot select DB");

  // select record from mysql 
  $sql="SELECT * FROM $tbl_name";
  $result=mysql_query($sql);
 ?>
<table>
<tr>
<td align="center"><strong>Post Number</strong></td>
<td align="center"><strong>UserName</strong></td>
<td align="center"><strong>Topic</strong></td>
<td align="center"><strong>Date</strong></td>
<td align="center"><strong>View</strong></td>
</tr>
<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td><? echo $rows['fourmid']; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><? echo $rows['username']; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><? echo $rows['fourmname']; ?   >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><? echo $rows['date']; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><a href="viewfourm.php?id=<? echo $rows['fourmid']; ?>">View Topic</a></td>
<?php
 // close while loop 
 }
 ?>

</tr>
</table>
<?php
// close connection; 
mysql_close();
?>
<hr width='67%' color='#29001F' size='3'/>
</center>

now viewfourm.php

 <?php

 $host="mysql13.000webhost.com"; // Host name 
 $username="a2670376_Users"; // Mysql username 
 $password="PASS"; // Mysql password 
 $db_name="a2670376_Pass"; // Database name 
 $tbl_name="fourm"; // Table name 

   // Connect to server and select database.
   mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
   mysql_select_db("$db_name")or die("cannot select DB");

    // select record from mysql 
   $sql="SELECT * FROM $tbl_name";
   $result=mysql_query($sql);
   ?>
  <table>
  <tr>
  <td align="center"><strong>Post Number</strong></td>
 <td align="center"><strong>UserName</strong></td>
 <td align="center"><strong>Topic</strong></td>
 <td align="center"><strong>Date</strong></td>
 <td align="center"><strong>View</strong></td>
 </tr>
 <?php
 while($rows=mysql_fetch_array($result)){
 ?>
 <tr>
 <td><? echo $rows['fourmid']; ? >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
 <td><? echo $rows['username']; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><? echo $rows['fourmname']; ?   >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><? echo $rows['date']; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><a href="fourm.php">back/a></td>
<?php
 // close while loop 
 }
 ?>

</tr>
</table>
<?php
// close connection; 
mysql_close();
?>
<hr width='67%' color='#29001F' size='3'/>
</center>

now on forum.php when i select what “forum” from MySql Database i want to view it loads all the forums i want to fix i know why its doing it its cause its the same script as the first one just modified a little bit but i did what i could do. i am selecting forum s thrue fourmid tag in MySql Database thats what the “>View Topic is about its supposed to load the forum with the id selected

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:16:14+00:00Added an answer on June 14, 2026 at 8:16 pm

    In viewfourm.php modify your sql query $sql="SELECT * FROM $tbl_name"; like this

    $fourmid= $_POST['fourmid']; //if passing using get method use $_GET['fourmid'];
    $sql = "SELECT * FROM $tbl_name WHERE
    fourmid= '$fourmid'";

    Also you have to pass fourmid from fourm.php to viewfourm.php

    EDIT

    Make a link like this

    <td>
    <a href="viewfourm.php?fourmid=<? echo $rows['fourmid']; ?>">
    <? echo $rows['fourmname']; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </a>
    </td>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On one PHP server I have two files. One file (the name is first.php)
I have file with name contact.php, inside I have form: <form method=post name=kontakt action=send_mail.php>
I have a forms directory inside my application directory with custom form php files
i have a problem, can't understund anyway. i have three files - index.php ,
I have two files: index.php /lib/user.php Index contains the form: <div class=<? echo $msgclass;
I have 3 files. I will give you the exact example: a.php <form action=b.php
I have two php files: main.class.php form.class.php in these files there are two class
I have a PHP form for uploading files and it works fine and displays
I have a php form that uploads files, and all files work good the
I have 2 files that are applicable to this question, myaccount.php and test5.php .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.