Php Easy Steps To Make Dynamic Page Tutorial
- Login to your database by providing your username and password
- Use Create Query to Create Database
CREATE DATABASE nameofdatabase; - Use Create Command to Create Tables
CREATE TABLE ITEMS_SHAHID4
(
ItemID INT PRIMARY KEY AUTO_INCREMENT,
ItemName VARCHAR(60),
ItemPrice DECIMAL(10, 2),
ItemCat VARCHAR(60),
ItemDesc TEXT
) - Open a new page of php using dreamweaver or any web designing software
- On this web page make a form if its an add page. but if its search page then make a table
- Right on the top of the page start your php tag and then follow these steps
- get the data from the form and store it in variables, if its an add page . you can get the data from the form by using $_POST
$name = $_POST['name'];
- Connect to Database by using two php functions. mysql_connect("server", "user", "password") mysql_select_db("database").
mysql_connect("10.0.7.5", "student", "bcc");
mysql_select_db("student"); - After connecting your website to database, now you can run queryies. to run your query use mysql_query() function..If you are selecting data from database, then your query will be select query. But if you are adding data to databae, then your query will be INSERT query.
mysql_query("INSERT INTO rich_prods(name, price, cat, description) VALUES('$name', '$price', '$cat', '$desc')") - The last step, you can go to database, and check if the information you added is there in databse.

