I currently have a database where items are stored with a specefic ID (EventCode). When I try to display them on my website with their unique ID, it's all messed up. Some items are ok, and show A, B, C and D correctly. Some others items show the same A, B, C and D of others events. When I look at the EventCode for each item, it's a different code... so regarding to the code below, what is my problem? Why does some item show perfecly what they are supposed the show, and others show the same as items alredy created?
<?php
include('base.php');
?>
<?php
if(isset($_GET['EventCode']))
{
$EventCode = intval($_GET['EventCode']);
$dn = mysql_query("select A, B, C, D from users_event where EventCode=$EventCode ");
if(mysql_num_rows($dn)>0)
{
$dnn = mysql_fetch_array($dn);
?>
This is the profile of "<?php echo htmlentities($dnn['A']); ?>" :
<table style="width:500px;">
<tr>
<td><?php
if($dnn['B']!='')
{
echo '<img src="'.htmlentities($dnn['B']).'" alt="B" style="max-width:100px;max-height:100px;" />';
}
else
{
echo 'B is not existing.';
}
?>
</td>
<td class="left"><h1><?php echo htmlentities($dnn['C']); ?></h1>
Field: <?php echo htmlentities($dnn['D']); ?><br />
</tr>
</table>
<?php
}
else
{
echo 'Sorry, no record found.';
}
}
else
{
echo 'No item found';
}
?>
</body>
</html>