Jump to content

Steve4900

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by Steve4900

  1. or can anyone give me simpler piece of code that will work? Cheers for all your help
  2. I have a shopping basket and i want a user to select from a check box a game that they dont want to buy which they entered by mistake this is what i got so far $conn = pg_connect("blah blah"); echo '<form name="hede" method="POST" action="cart.php">'; echo "<table border='5'>"; $res = pg_query ($conn, "SELECT * from Top where $res=e($sql);"); while ($row = pg_fetch_assoc($res)) { echo "<tr>"; echo "<td>"; echo "<input type=\"checkbox\" name=\"games[]\" value=\"" . $row['refcode'] ."\">"; echo "</td>"; echo "<td>"; echo $row['title']; echo "</td>"; echo "<td>"; echo $row['description']; echo "</td>"; echo "<td>"; echo $row['price']; echo "</td>"; echo "</tr>"; if($delete){ for($i=0;$i<$count;$i++){ $del_id = $checkbox[$i]; $sql = "DELETE FROM Top WHERE id='$del_id'"; $res = e($sql); } } } echo "</table>\n"; echo '</form>'; ?> But i think im getting my_sql confused with postgresql any ideas cheers and i need it in postgresql
  3. I have a shopping basket and i want a user to select from a check box a game that they dont want to buy which they entered by mistake this is what i got so far $conn = pg_connect("blah blah"); echo '<form name="hede" method="POST" action="cart.php">'; echo "<table border='5'>"; $res = pg_query ($conn, "SELECT * from Top where $res=e($sql);"); while ($row = pg_fetch_assoc($res)) { echo "<tr>"; echo "<td>"; echo "<input type=\"checkbox\" name=\"games[]\" value=\"" . $row['refcode'] ."\">"; echo "</td>"; echo "<td>"; echo $row['title']; echo "</td>"; echo "<td>"; echo $row['description']; echo "</td>"; echo "<td>"; echo $row['price']; echo "</td>"; echo "</tr>"; if($delete){ for($i=0;$i<$count;$i++){ $del_id = $checkbox[$i]; $sql = "DELETE FROM Top WHERE id='$del_id'"; $res = e($sql); } } } echo "</table>\n"; echo '</form>'; ?> But i think im getting my_sql confused with postgresql any ideas cheers
×
×
  • 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.