i have 2 fichiers fourm.php et viewfourm.phpMySql/PHP Forum Problèmes avec sélection Forum Pour Voir
fourm.php premier
<?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']; ?> </td>
<td><? echo $rows['username']; ?> </td>
<td><? echo $rows['fourmname']; ? > </td>
<td><? echo $rows['date']; ?> </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>
maintenant 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']; ? > </td>
<td><? echo $rows['username']; ?> </td>
<td><? echo $rows['fourmname']; ? > </td>
<td><? echo $rows['date']; ?> </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>
maintenant sur forum.php quand je sélectionne ce "forum" de base de données MySql je veux voir il charge tous les forums que je veux réparer je sais pourquoi il le fait sa cause le même script que le premier juste modifié un peu mais je l'ai fait Je pourrais le faire. je suis choisissais tag thrue de fourmid de forum dans la base de données MySql c'est ce que le « > Voir sujet est sur son supposé charger le forum avec l'ID sélectionné
sql vurnurable Je sais fix mal plus tard une fois que je résoudre ce –
[** S'il vous plaît, ne pas utiliser les fonctions '' * de mysql_ dans le nouveau code **] (http: // bit .ly/phpmsql). Ils ne sont plus maintenus et le [processus de dépréciation] (http://j.mp/Rj2iVR) a commencé dessus. Voir la [** boîte rouge **] (http://j.mp/Te9zIL)? En savoir plus sur [* instructions préparées *] (http://j.mp/T9hLWi) à la place, et utiliser [PDO] (http://php.net/pdo) ou [MySQLi] (http://php.net/ mysqli) - [cet article] (http://j.mp/QEx8IB) vous aidera à décider lequel. Si vous choisissez PDO, [voici un bon tutoriel] (http://j.mp/PoWehJ). – PeeHaa
MySQLi encore en train d'apprendre MySQL et PHP lol malade apprendre que la prochaine, mais pour moi MySQL est plus facile –