How to get example codes for bigginers in PHP. I am very much interested do learn PHP 5.0 and Mysql 5.0 in linux environment.
I am new PHP from Perl, How to connect MySql from PHP under linux environment.?
%26lt;?php
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);
You probably DONT want to use root to connect but change that to your username for the database you setup. You probably will also need the password for that user.
That connects you.
If you want a good starting place for tutorials
try.
http://www.webmonkey.com/webmonkey/99/21...
http://www.goodphptutorials.com/category...
Reply:The best place to learn php is from the guys that made the darn thing.
http://www.php.net
look up mysql in the function list
RJ
Reply:The best way is to include a variation of the DB object from PEAR:
require_once "DB.php";
$db = DB::connect("mysql://user:password@host/...
[etc]...
Reply:www.phpfreaks.com , www.mysql.org , Good luck :)
Reply:The syntax of connection from php to MySql database is:
mysql_connect("host name","login","password");
here,
(1) mysql_connect is the name of function
(2)hostname will be localhost if your database and webserver is same else check your host settings for external database server.
(3)login and password is root and blank in default in easyphp, else provide your custom created
eg:
$db = mysql_connect("localhost", "root",""); //connect to database and store the connection point to $db
mysql_select_db("mydb",$db); //select the database name mydb from connection $db
Search in Yahoo/Google for "php beginner tutorials"
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment