473,775 Members | 2,529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Insert record using a var - basic question :(

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)",
GetSQLValueStri ng($_POST['ID_PDF'], "int"),
GetSQLValueStri ng($_POST['MarcaLinea_Pdf '],
"int"),
GetSQLValueStri ng($_POST['NomePdf'], "text"),
GetSQLValueStri ng($_POST['Pdf_icona'], "text"),
GetSQLValueStri ng($_POST['Pdf_Doc'], "text"));

mysql_select_db ($database_Conn _Bianchi, $Conn_Bianchi);
$Result1 = mysql_query($in sertSQL, $Conn_Bianchi) or
die(mysql_error ());

Thank you
Nov 27 '07 #1
3 1488
..oO(ni******** @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
Nov 27 '07 #2
On 27 Nov, 13:00, Michael Fesser <neti...@gmx.de 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
Nov 27 '07 #3
..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
Nov 27 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
17019
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums must be UPDATED, if not, they must be INSERTED. Logically then, I would like to SELECT * FROM <TABLE> WHERE ....<Values entered here>, and then IF FOUND UPDATE <TABLE> SET .... <Values entered here> ELSE INSERT INTO <TABLE> VALUES <Values...
2
8570
by: Bill | last post by:
I'm having what seems to me to be an odd problem. Perhaps there is some explanation, but don't know at this point. Basically I have a form that tracks memberships and donations. The main form tracks the individual and the subform allows me to add donation amounts or membership fee payments. It's fairly basic. Well what I want to do is when I enter a new membership payment it looks to another table. If the person is currently a member,...
8
6298
by: Carl | last post by:
Hi, I hope someone can share some of their professional advice and help me out with my embarissing problem concerning an Access INSERT query. I have never attempted to create a table with one-to-one relationship but on this occasion I must keep username/password details within a seperate table. Here's the basic specs and database schema: -------------------------------------------
5
5610
by: Louis LeBlanc | last post by:
Hey folks. I'm new to the list, and not quite what you'd call a DB Guru, so please be patient with me. I'm afraid the lead up here is a bit verbose . . . I am working on an application that uses very high volume DB transactions - in the order of tens of millions per day . . . Anyway, the current database which will remain nameless, but begins with O and rymes with debacle (sorta), has a problem with high volume work when it comes to...
7
28752
by: Cindy H | last post by:
Hi I'm having a problem getting the insert statement correct for an Access table I'm using. The Access table uses an autonumber for the primary key. I have tried this: INSERT INTO Tournaments (Tournament, MemberName, Score) VALUES (vtournament, vMemberName, vScore) SELECT ID, Tournament, MemberName, Score FROM Tournament WHERE (ID = @@IDENTITY);"
4
1481
by: unwantedspam | last post by:
Hi All, Thank you in advance. I am trying to insert into two tables but I am getting the following error: "You cannot add or change a record because a related record is required in table..." I am not sure why this is happening since I am using transactions. Below is the code I am using. Dim con as OleDbConnection Dim cmd as OleDbCommand Dim tran as OleDbTranscation
10
12717
by: MLH | last post by:
Suppose, in a multi-user environment, you have append query SQL in a VBA procedure that looks like INSERT INTO MyTable... and the next line reads MyVar=DMax("","MyTable... You can never be certain that MyVar will be set to the key-field value that was created when the Append query ran. Now, there are other ways to do it - I know - that will ensure you 'nab' the correct record. But I was wondering
6
10969
by: eighthman11 | last post by:
Hi everyone: Using Sql Server SQL 8 I'm trying to INSERT records into a "can software package" batch table. I have a work-table that mimics the batch table. After manipulating the records in the work-file I want to INSERT them into the batch table. The problem is the batch table in the can software has a trigger on the batch table which is going to force me to INSERT one record at a
8
6493
by: SaltyBoat | last post by:
Needing to import and parse data from a large PDF file into an Access 2002 table: I start by converted the PDF file to a html file. Then I read this html text file, line by line, into a table using a code loop and an INSERT INTO query. About 800,000 records of raw text. Later, I can then loop through and parse these 800,000 strings into usable data using more code. The problem I have is that the conversion of the text file, using a...
17
6609
geolemon
by: geolemon | last post by:
This should be an easy one for anyone with basic forms experience (I'd hate for you guys to be bored!) :D I have a simple form, bound to a single table. I'd *like* the form to work this way: The form should open and be all blank. If the user selects the "Job Order Number" control and picks an existing Job Order Number, all the controls on the form will position to that job order. When the user manipulates the data in other form...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10270
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10051
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9916
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6718
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5360
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4017
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2853
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.