not just copy and pase,I want finding some beautiful things. before two years,I learn to database from a school ,but you know,I still not understand how is it , what database process is? Just do some add\delete\select\?another one. And now, I learn some web skill, css\html .ex. I discover web is very beautiful,like your web. i can't link together with database and web,so can i learning knowledge systematically?
google php database tutorials. You will learn all you need to do a database over the web. You can also try www.lynda.com. They have video tutorials, but you will have to pay for them. You can also check the video section on this site. There might be some there
Lets say you have a database named testdb, with a username of admin and a password of admin1. With the following PHP code, you can connect to the database, which is required if you want to add or delete stuff in it.
<?php mysql_connect("localhost", "admin", "admin1") or die(mysql_error()); echo "Connection to MySQL established"; mysql_select_db("testdb") or die(mysql_error()); echo "Also connected to the testdb database"; ?>
The following code will insert some stuff in the testdb database. Lets say that database has a table in it named tableone.
<?php mysql_query("INSERT INTO tableone (city, country) VALUES('New York', 'USA' ) ") or die(mysql_error()); ?>
This (city, country) code means stuff will be inserted in those columns, and the stuff will be ('New York', 'USA').
The line die(mysql_error()); means that it will the mysql error if there is any.
With the following PHP code, you can connect to the database, which is required if you want to add or delete stuff in it.
The following code will insert some stuff in the testdb database. Lets say that database has a table in it named tableone.
This
(city, country)code means stuff will be inserted in those columns, and the stuff will be('New York', 'USA').The line
die(mysql_error());means that it will the mysql error if there is any.You can find some very handy information here: http://www.tizag.com/mysqlTutorial/