Jump to content

php missing 1 database entry


crawlerbasher

Recommended Posts

What could cause a script to miss 1 database entry.

 

I've got 5 database entry and the script only shows 4.

And for some resion it always misses id number 2 but when its edited in the mysql then another database entry goes missing.

 

$con = mysql_connect($db_server, $db_username, $db_password); // Connects to your database
if (!$con) {
		die('Could not connect: ' . mysql_error()); // error message when failed to connect.
		}
mysql_select_db($db_name) or die(mysql_error());
$query = "SELECT * FROM GalkaDownloads ORDER BY `name` ASC";
$result = mysql_query( $query );
$data = mysql_fetch_assoc($result);

while($data = mysql_fetch_assoc($result)) {
?>
  <tr>
    <td align="left" valign="top" bgcolor="#FFFFFF"><a href="download.php?id=<?php echo $data['id']; ?>"><?php echo $data['name']; ?></a></td>
    <td align="left" valign="top" bgcolor="#FFFFFF"><?php echo $data['Category']; ?></td>
    <td align="center" valign="top" bgcolor="#FFFFFF"><strong><?php echo $data['count']; ?></strong></td>
    <td align="left" valign="top" bgcolor="#FFFFFF"><?php echo nl2br($data['information']); ?></td>
  </tr>
<?php
  }
?>  

Link to comment
https://forums.phpfreaks.com/topic/202592-php-missing-1-database-entry/
Share on other sites

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.