English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I know how to read/write/change table values. I just need the initial connection info.

2006-11-16 03:56:22 · 5 answers · asked by shaunhelsom 2 in Computers & Internet Programming & Design

5 answers

http://www.php-mysql-tutorial.com/connect-to-mysql-using-php.php

2006-11-16 03:58:50 · answer #1 · answered by arus.geo 7 · 0 0

you're lacking the database call. you ought to use the hot mysql library for Hypertext Preprocessor, this is mysqli particularly of mysql. This mysql library which you're using will quickly be deprecated. this is the hot way of connecting. @ $db = new mysqli('dblocation' ,'username','password', 'dbname');

2016-10-22 04:56:42 · answer #2 · answered by connely 4 · 0 0

It depends on what version of PHP you have.

If you are lucky, you have PHP 5.1+ that has PDO built in.

If you do, all you need to do is create a new PDO object:

$dbh = new PDO( 'mysql:host=localhost;dbname=test', $user, $pass);

if you aren't as lucky, you will need to use either the mysqli or mysql functions:

$dbh = mysqli_connect ( [string host [, string username [, string passwd [, string dbname [, int port [, string socket]]]]]] );

OR

$dbh = mysql_connect( 'mysql_host', 'mysql_user', 'mysql_password');

2006-11-16 04:04:08 · answer #3 · answered by John J 6 · 0 0

mysql_connect('localhost','root','') or die('Cannot connect mysql server');
mysql_select_db('new') or die('cannot connect database');
?>

2014-07-14 01:00:45 · answer #4 · answered by guru 1 · 0 0

http://localhost/phpmyadmin/

Is that what you mean?

2006-11-16 03:59:47 · answer #5 · answered by Anonymous · 0 0

fedest.com, questions and answers