Form to MYSQL Database

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
Peter_
Forum Newbie
Posts: 2
Joined: Sat Jun 25, 2011 11:35 pm

Form to MYSQL Database

Post by Peter_ »

Hi,

What I want to do is have a form where a user can input a specific html address and time and have the entered address be stored to a database and accessed at the user specified time. Is this possible to do using PHP?
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Form to MYSQL Database

Post by social_experiment »

From your question : yes. Can you give more information about what you have in mind with the script? (or any code that you may have created).
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Peter_
Forum Newbie
Posts: 2
Joined: Sat Jun 25, 2011 11:35 pm

Re: Form to MYSQL Database

Post by Peter_ »

I haven't written any code yet, I just wanted to get pointed in the right direction of how I should approach this. (Haven't written much PHP, but have experience w/ other languages)

Making the actual form is the easy part, but is there a certain function that can save the results to a sql database? How can I get the database to access these url's at the specific time that was chosen by the user?

Thanks for the help.
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Form to MYSQL Database

Post by social_experiment »

Peter_ wrote:... but is there a certain function that can save the results to a sql database? How can I get the database to access these url's at the specific time that was chosen by the user?
Adding data to the database is generally more of a process but you can create a function. To insert data into a mysql database you would use the insert query

Code: Select all

<?php
 $sql = "INSERT INTO table_name (field1, field2, field3) VALUES (escape_val_1, escape_val_2, escape_val_3) ";
?>
For the second part i would have to guess you can use CRON jobs, but i don't know how those work so i won't risk an explanation on that.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply