Click to See Complete Forum and Search --> : pgsql problem


swl7
04-30-2008, 09:52 AM
Hey

I have a pgsql database and im trying to query it with check boxes. for example when someone clicks on 3 check boxes and clicks on the button checkout it takes them to a different page called cart and displays them this is what i have so far i have been messing around with it for hours for i might of messed things up.



<?php
$x=$_POST["name"];
echo"x=$x";

$conn = pg_connect("blah blah");
$res = pg_query ($conn, "select * from Games where refcode $x ");
echo '<form name="hede" method="POST" action="cart.php">';
echo "<table border='5'>";
while($a = pg_fetch_row($res)) {
echo "<tr>";
?>
<td><input type="checkbox" name="box1[]" value="refcode"> 1</td>
<?php
for ($j = 0; $j < pg_num_fields($res); $j++){
echo "<td>" . $a[$j] . "</td>";
}
echo "</tr>";
}
echo "</table>\n";
echo '<input type="submit" name="check" value="SEND">';
echo '</form>';
?>



Cheers