Insert record using a var - basic question :(
Insert record using a var - basic question :(
am 27.11.2007 12:39:18 von nicemotion
Hallo,
i need to insert in the 'MarcaLinea_Pdf' field the value of the var
'recordID' sent from a page ( insert_pdf.php?recordID=14)
it's easy, i know, but...
Also, how to Printout the value of recordID ?
The insert code is as follows:
$insertSQL = sprintf("INSERT INTO pdf (ID_PDF, MarcaLinea_Pdf,
NomePdf, Pdf_icona, Pdf_Doc) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['ID_PDF'], "int"),
GetSQLValueString($_POST['MarcaLinea_Pdf'],
"int"),
GetSQLValueString($_POST['NomePdf'], "text"),
GetSQLValueString($_POST['Pdf_icona'], "text"),
GetSQLValueString($_POST['Pdf_Doc'], "text"));
mysql_select_db($database_Conn_Bianchi, $Conn_Bianchi);
$Result1 = mysql_query($insertSQL, $Conn_Bianchi) or
die(mysql_error());
Thank you
Re: Insert record using a var - basic question :(
am 27.11.2007 13:00:22 von Michael Fesser
..oO(nicemotion@gmail.com)
>i need to insert in the 'MarcaLinea_Pdf' field the value of the var
>'recordID' sent from a page ( insert_pdf.php?recordID=14)
>
>it's easy, i know, but...
>
>Also, how to Printout the value of recordID ?
$_GET['recordID']
Micha
Re: Insert record using a var - basic question :(
am 27.11.2007 13:24:27 von nicemotion
On 27 Nov, 13:00, Michael Fesser wrote:
> .oO(nicemot...@gmail.com)
>
> >i need to insert in the 'MarcaLinea_Pdf' field the value of the var
> >'recordID' sent from a page ( insert_pdf.php?recordID=14)
>
> >it's easy, i know, but...
>
> >Also, how to Printout the value of recordID ?
>
> $_GET['recordID']
>
> Micha
Yah :((
dunno why before didn't work
Tks a lot, nik
Re: Insert record using a var - basic question :(
am 27.11.2007 13:44:28 von michael.martinek
>
> dunno why before didn't work
>
> Tks a lot, nik
If the page is submitted with a POST method, then your values will be
available in $_POST. If it's submitted with a GET, or blank method
then the values will be available in $_GET. In most cases, you can
just use $_REQUEST, which will access $_GET, $_POST, $_COOKIE globals.
I believe the order in which $_REQUEST is populated with is defined in
the PHP configuration. In most cases, however, you will not have
colliding $_GET and $_POST names; nor colliding $_COOKIE names.
Re: Insert record using a var - basic question :(
am 27.11.2007 14:13:16 von Michael Fesser
..oO(Michael Martinek)
>> dunno why before didn't work
>>
>> Tks a lot, nik
>
>If the page is submitted with a POST method, then your values will be
>available in $_POST. If it's submitted with a GET, or blank method
>then the values will be available in $_GET.
The 'action' URL in a POST form may also contain a query string, so the
script would receive both GET and POST data.
>In most cases, you can
>just use $_REQUEST, which will access $_GET, $_POST, $_COOKIE globals.
In most cases using $_REQUEST is a really bad idea, since you don't know
where your data is coming from.
If you expect a URL parameter, use $_GET. If you want to access a cookie
value, use $_COOKIE etc. $_REQUEST is useful only in very rare cases.
Micha