tags:

views:

22

answers:

2

I'm making a webshop for a school asignment and therfore i needed to make a shopping cart. In the shopping cart the data is storred in an array.

The code for when I echo it out is

<tr>
  <td><?php echo $row['Navn'];?></td>
  <td><input type="text" name="antall-<?php echo $row['id_produkt'];?>" size="5" value="
<?php echo $_SESSION['handlekurv'][$row['id_produkt']]['antall'];?>" /> </td>
  <td><?php echo $row['Pris'];?></td>
  <td><?php echo $_SESSION['handlekurv'][$row['id_produkt']]['antall']*$row['Pris'];?></td></tr>

What i want is the store the data this code echoes out from the array, in a sql database.

Is there anyone who can help me whith this problem?

A: 

Use the example here: http://php.net/manual/en/function.mysql-query.php

bogdanvursu
A: 

Replace the string passed to mysql_query function with an INSERT statement, which is explained here: http://dev.mysql.com/doc/refman/5.1/en/insert.html

bogdanvursu