Click here to Skip to main content
14,970,162 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

i need to know how to connect php with database sql.. plz help

plz explain in the code also... thanks in advance :):)

Sandeep Mewara 8-Jan-13 10:05am
It does not work like this here.

Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.

What have you tried? There are hundreds of samples on the web: let me google for you!
$host="MySQL_Server(localhost in most cases)";
$conn=mysql_connect($host, $user, $pass) or die("cannot connect to mysql server");

Hope You Understand... It is only to connect mysql server... For execute queries you can use PHP function mysql_query("Your Query");

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900