MySQL Forums :: PHP :: Query insert into works in PHP admin but from web do not


Advanced Search

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

Hi,

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;
<?php

require('db.php');

// 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" />

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

Any suggestions
Thanks

Janis

Options: ReplyQuote


Subject Written By Posted
Query insert into works in PHP admin but from web do not Janis Janovskis 10/13/2009 05:14AM
Re: Query insert into works in PHP admin but from web do not Peter Brawley 10/13/2009 10:17PM
Re: Query insert into works in PHP admin but from web do not Selim Lasram 10/14/2009 02:43AM
Re: Query insert into works in PHP admin but from web do not Janis Janovskis 10/15/2009 12:03PM
Re: Query insert into works in PHP admin but from web do not Janis Janovskis 10/16/2009 04:15AM
Re: Query insert into works in PHP admin but from web do not Janis Janovskis 10/15/2009 12:02PM
Re: Query insert into works in PHP admin but from web do not Peter Brawley 10/15/2009 03:30PM


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.