mySQL stopped inserting after using HTML POST method

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
serap
Forum Commoner
Posts: 31
Joined: Thu Jan 15, 2004 5:10 pm

mySQL stopped inserting after using HTML POST method

Post by serap »

I have recently changed my HTML code where my inserting into mySQL stopped working

BEFORE I were using:

echo "<a href=\"cart1.php?action=add_item&id=$itemId&qty=1&colorid=$color\"><img src=\"http://www.aaa.gif\" border=\"0\"></a>\n";

which called cart1.php

function AddItem($itemId, $qty, $color)
{
@mysql_query("insert into cart(cookieId, itemId, qty)
values('" . GetCartId() . "', $itemId, $qty)");
...
...

This worked fine inserting the values

AFTER I used only HTML Post (calling the exact same php code):

<td valign="top"><form name="form"method="post"action="cart1.php">

I can echo all variables on the screen but nothing is inserted

function AddItem($id, $qty, $color)
{
$cookieId = GetCartId();

@mysql_query("insert into cart(cookieId, itemId, qty)
values('" . GetCartId() . "', $itemId, $qty)");

echo $cookieId;
echo $color;
echo $id;
echo $qty


WHAT is the difference between the two methods????

thanks
serap
Forum Commoner
Posts: 31
Joined: Thu Jan 15, 2004 5:10 pm

Post by serap »

ok that was a stupid one $id vs $itemid.....
Post Reply