Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   php and database (http://www.go4expert.com/forums/php-and-database-t22875/)

hardik soni 30Jul2010 20:00

php and database
Hello everyone,

I am new in PHP. I want to know how to establish connection between PHP and any database, Please guide me if you can...

In Anticipation....

shabbir 30Jul2010 20:12

Re: php and database

hardik soni 30Jul2010 20:18

Re: php and database
All right nice info from that site
but can anybody let me know something in your own language for the same topic ?


johnny.dacu 30Jul2010 20:33

Re: php and database
well... is simple. to estabish a mysql connection use:
PHP Code:


to select a database:
PHP Code:


to perform a mysql query:
PHP Code:

mysql_query("query string"); 

ManzZup 7Aug2010 09:49

Re: php and database
First you need to make a database from your admin panel. (hope you know to do that)

Then the following script would give the basic concept of connecting:

PHP Code:


$password "your_db_password";
$database "your_database_name";
$host "your_host_address";

$db_handle mysql_connect($host$username$password);
$db_found mysql_select_db($database$db_handle);

"Auuraah You sucessfully connected!";
"ahh Try Again!!";

All times are GMT +5.5. The time now is 17:31.