RizwanAhmedMemon Posted May 24, 2013 Share Posted May 24, 2013 I am creating an admission form which will ask for the information such as name, class, level, and such other information, so, I don't know how to connect to the database and how to make the database and how the database will store all that information. Can anybody explain it with real example with the code? Link to comment Share on other sites More sharing options...
niche Posted May 24, 2013 Share Posted May 24, 2013 http://www.w3schools.com/php/php_mysql_connect.asp Link to comment Share on other sites More sharing options...
MarkT Posted May 29, 2013 Share Posted May 29, 2013 (edited) I am creating an admission form which will ask for the information such as name, class, level, and such other information, so, I don't know how to connect to the database and how to make the database and how the database will store all that information. Can anybody explain it with real example with the code? Basically;<?PHP mysql_connect ([color=#444444]host,username,password,dbname);[/color] [color=#ff0000]$name = $_POST['name'][/color][color=#ff0000]$class = $_POST['class'][/color][color=#ff0000]$level = $_POST['level'][/color] mysql_query("INSERT into {TABLE NAME} VALUES ('{$name}', '{$class}', '{$level}') ?> For the bits in red; this is based on you using a HTML form using the method = POST For example; <form type='submit.html' method='POST'>Name: <br><input type='text' name='name'><br>Class: <br><input type='text' name='class'><br>Level: <br><input type='number' name='level'><br><input type='submit' name='submit' value='Login'></form> Edited May 29, 2013 by MarkT Link to comment Share on other sites More sharing options...
guruparthi Posted October 27, 2014 Share Posted October 27, 2014 (edited) The below 2 steps areworked in backend process for store values into database First need to create database in your Phpmyadmin create table with required field Then in php make form with required field make connection with database using PHP get values from form and store it to database Edited October 27, 2014 by Ingolme Advertising Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now