Sunday, February 27, 2011
Connection database in PHP
Before make the full website, we must know about HTML code. I think it is very easy. You can study by your self about HTML code. Now we want to make database connection with PHP. To connect with database, first you must make the connection code with php to connect database.
The connection code for standard connection with mysql
Now, we try to use the coding For this case I use localhost as my server,root as my username,dbtes as my database and no password in my database..So the connection cose we use like below
After your type all of the code,save the code as .inc extension to make more secure. Notice that don't use .php extension
The connection code for standard connection with mysql
mysql_connect("server name","user name","password"); mysql_select_db("database"); ?> ------------------------------------------------------------------------------------ note:
|
Now, we try to use the coding For this case I use localhost as my server,root as my username,dbtes as my database and no password in my database..So the connection cose we use like below
mysql_connect("localhost","root",""); mysql_select_db("dbtes"); ?> |
After your type all of the code,save the code as .inc extension to make more secure. Notice that don't use .php extension
This post was written by: Yung Fei
Follow me on My Twitter and like my Online Coupons fans page
- Best Regard -
OnlineCouponz
Fresh Printable Coupons
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment