MySQL Forums
Forum List  »  PHP

Query insert into works in PHP admin but from web do not
Posted by: Janis Janovskis
Date: October 13, 2009 05:14AM


I am developing small web app for accouters, I am stacked with this recipes insert form using mysql query = insert into. from phpmyadmin it works fine, but from web it is not inserting right;

here is the code;


// Create the variables
$ceksNR = $_POST["ceksNR"];
$konts = $_POST["konts"];
$apraksts = $_POST["apraksts"];
$piegadatajs = $_POST["piegadatajs"];
$datums = $_POST["datums"];
$PVN = $_POST["PVN_%"];
$summa_ar_PVN = $_POST["summa_ar_PVN"];
// Inserts the data into the database
$result= MYSQL_QUERY(
"INSERT INTO recipes (dokumenta_ID, ceksNR, konts, apraksts, piegadatajs, datums, PVN_%, summa_ar_PVN)".
"VALUES ('', '$ceksNR', '$konts', '$apraksts', '$piegadatajs', '$datums', '$PVN', '$summa_ar_PVN')"
echo "Paldies, dokuments jūsu dokuments Nr. $ceksNR ir piereģistrēts datu bāzē.";
and html form
<form action="vaicajumi/datainserttest.php" method="post">

Kases čeka nummurs:<br />
<input name="ceksNR" type="text" /><br />

Izdevumu konts:<br />
<input name="konts" type="text" /><br />

Izdevumu apraksts <br />(ievadiet atbilstošu kategoriju):<br />
<input name="apraksts" type="text" /><br />

Piegadatajs:<br />
<input name="piegadatajs" type="text" /><br />

Datums (gads.mēn.diena):<br />
<input name="datums" type="text" /><br />

PVN (%):<br />
<input name="PVN_%" type="text" /><br />

Ievadiet pirkuma summu ar PVN:<br />
<input name="summa_ar_PVN" type="text" /><br />

<input type="submit" />

Maybe I am doing something wrong? from my side it looks right and it should work.

Any suggestions


Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.