faqts : Computers : Programming : Languages : PHP : Database Backed Sites : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 12 people (67%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How to connect to a MySQL db from inside a PHP extension ?

Jun 25th, 2001 20:11
urge overkill, Jean Gagliardi, Ben Udall,


hi
i am little confused as to what you mean by 'extension' and assume that 
you mean php script or file.
if this assumption is correct, read further else ignore!
you can use the following two php functions to do so..
	$db_link=mysql_connect("hostname","username","password");
	$db_connect=mysql_select_db("dbname",$db_link);
hostname can be put as "localhost"
hope this helps. Check out the php manual at www.php.net for further 
details.
cheers!