MySQL doubling Array contents
Posted: Tue Mar 23, 2010 5:18 pm
When I query my db it seems be be returning an array with double the entries that it should have, like this,
The [0] [1] and [2] are just doubles of the entries that I've made.
query looks like this,
db structure looks like this,
Code: Select all
Array ( [0] => 1 [title_id] => 1 [1] => Fifa 10 [game_title] => Fifa 10 [2] => COD 4 [wanted1] => COD 4 )query looks like this,
Code: Select all
<?php
$sql = "SELECT * " ;
$sql .= "FROM current_offers ";
$sql .= "WHERE game_title='{$_GET['title']}' AND wanted1='{$_GET[wanted1]}'";
$result = query($sql);
while ($row = mysql_fetch_array($result)) {
print_r($row);
echo "<br />";
}
?>Code: Select all
title_id game_title wanted1
1 Fifa 10 COD 4
2 FIFA NULL