Jump to content

MySQL Data will not display


zac1989

Recommended Posts

I'm not sure what I'm doing wrong here...

 

This is my index

<html

<head>
<title>Admin applications</title>
</head>

<body text="#000000">


<center>
<?php
include("connect.php"); 


echo "<table cellpadding='3' cellspacing='2' summary='' border='3'>";

echo "<tr><td>Real name:<br><br>";
echo $row['real_name'];

echo "</td><td>Age:<br><br>";
echo $row['age'];

echo "</td><td>In-Game Name:<br><br>";
echo $row['game_name'];

echo "</td><td>Steam ID:<br><br>";
echo $row['steamid'];

echo "</td><td>Agreement:<br><br>";
echo $row['agreement'];

echo "</td><td>Will use vent:<br><br>";
echo $row['vent'];

echo "</td><td>Activity:<br><br>";
echo $row['activity'];

echo "</td><td>Why this person wants to be an admin:<br><br>";
echo $row['why'];

echo "</td></tr></table>";
?>

</center>
</body>

</html>

 

and this is my database connect

<?php  
$database="admin";  
mysql_connect ("localhost", "root", "waygan914");  
@mysql_select_db($database) or die( "Unable to select database");
mysql_query("SELECT * FROM applications");
?>

 

The database table "applications" has 8 fields, and 2 records, but when I view the page i get the table but no data:

table.jpg

 

Link to comment
https://forums.phpfreaks.com/topic/223467-mysql-data-will-not-display/
Share on other sites

Easy, laid back morning...

<html
<head>
<title>Admin applications</title>
</head>
<body text="#000000">
<center>
<?php
include("connect.php"); 
$query = "SELECT * FROM your_table_name_here";
$result = mysql_query($query);
?>
<table cellpadding="3" cellspacing="2" summary="" border="3">
<tr>
	<td>Real Name</td>
	<td>Age</td>
	<td>In-Game Name</td>
	<td>Steam ID</td>
	<td>Agreement</td>
	<td>Will Use Vent</td>
	<td>Activity</td>
	<td>Why This Person Wants To Be An Admin</td>
</tr>
while($row = mysql_fectch_array) {
	?>
	<tr>
		<td><?PHP echo $row['real_name']; ?></td>
		<td><?PHP echo $row['age']; ?></td>
		<td><?PHP echo $row['game_name']; ?></td>
		<td><?PHP echo $row['steamid']; ?></td>
		<td><?PHP echo $row['agreement']; ?></td>
		<td><?PHP echo $row['vent']; ?></td>
		<td><?PHP echo $row['activity']; ?></td>
		<td><?PHP echo $row['why']; ?></td>
	</tr>
	<?PHP
}
?>
</table>
</center>
</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.