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
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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.