Page 1 of 1

Form to MYSQL Database

Posted: Sat Jun 25, 2011 11:44 pm
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?

Re: Form to MYSQL Database

Posted: Sun Jun 26, 2011 8:37 am
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).

Re: Form to MYSQL Database

Posted: Sun Jun 26, 2011 12:26 pm
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.

Re: Form to MYSQL Database

Posted: Sun Jun 26, 2011 4:27 pm
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.