![]() $query = "INSERT INTO table_name (col1, col2, col3, col4, col5) $field5 = $mysqli->real_escape_string($_POST) $field4 = $mysqli->real_escape_string($_POST) $field3 = $mysqli->real_escape_string($_POST) $field2 = $mysqli->real_escape_string($_POST) That script can have a syntax similar to the following: real_escape_string($_POST) Upon clicking the Submit button the data submitted by the user will be passed to a script named insert.php. The above HTML code will show the user 5 text fields, in which the user can input data and a Submit button. The following HTML code that and passes the information to a PHP script: ![]() ![]() To populate a new database table with data you will first need an HTML page which will collect that data from the user. To display the table data it is best to use HTML, which upon filling in some data on the page invokes a PHP script which will update the MySQL table. Very often you will need to use a MySQL table to store data inside it and then output that data by using a PHP script.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |