Hi,
Im doing a basic shopping cart using a Access database. the below code is pulling data from my database with a checkbox after each item. What I want to know is how can I post the selected items to the next page, add them up and pull them from the database.
Any help would be greatly appreciated
<?php
$conn = new COM ("ADODB.Connection") or die("Cannot start ADO");
//define connection string, specify database driver
$connStr="PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Inetpub\wwwroot\mbsebus08\AHunt\Databases\member.mdb";
//Open the connection to the database
$conn->open($connStr);
echo "Connection Open<br>";
//recordset code
$rS = $conn->execute("SELECT * FROM products");
$f1 = $rS->Fields(0);
$f2 = $rS->Fields(1);
$f3 = $rS->Fields(2);
$f4 = $rS->Fields(3);
$i =0;
while (!$rS->EOF )
{
echo "<tr>
<td align='center'>". $f1->value."</td>
<td align='center'>". $f2->value."</td>
<td align='center'>".$f3->value."</td>
<td align='center'><img src='Images/".$f4->value."'/></td>
<td align='center'><input type='checkbox' name='checkbox".$f1->value."'></td>
<tr>";
$rS->MoveNext();
$i++;
}
$rS->Close();
$conn->Close();
?>
</table>
<p>
<center>
<input type="submit" value="Add Items to Cart" />
</center>
</p>
</form>
</body>
</html>