Insert Recod into MySQL Database w/o form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Clukey
Forum Commoner
Posts: 60
Joined: Fri Apr 21, 2006 9:05 pm

Insert Recod into MySQL Database w/o form

Post by Clukey »

I have to insert a record into a database, but I am not able to use a form. How could I do this? Thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Inserting the data into a database is independent of where the data comes from. It is generally recommended that data submitted by a use comes from a post request, but you could get the parameters from a URL get request or from a data feed like RSS or any other source.

PHP also supports the cURL library to allow a script to connect directly to another website or other data source.
(#10850)
Clukey
Forum Commoner
Posts: 60
Joined: Fri Apr 21, 2006 9:05 pm

Post by Clukey »

I've just got about 5 variables and I want them to be inserted into a database immidiately when the page it executedn I don't have to request the variables from anywhere since they are POSTed to the page, and I know how to access those, but I can't seen to find the right code to get it into the database. I've tried mysql_query but it hasn't worked, although I might have formatted it wrong. Got any sugestions? Thanks.
Post Reply