unable to connect to database

Problems with the Windows version of XAMPP, questions, comments, and anything related.

unable to connect to database

Postby dennisl » 06. July 2009 11:32

Hi,

I have a problem in connecting to Xampp database.

I have tried the following but it didn't work.

db_conenction.php
Code: Select all
<? php
//Define database connection constants
define ('db_host', 'localhost');
define ('db_un', 'root');
define ('db_psw', '');
define ('db_name', 'medocs');
?>


test.php
Code: Select all
<?php
  require_once('db_connection.php');

// Connect to the database
 $dbc = mysqli_connect(db_host, db_un, db_psw, db_name);
........


When we visit test.php, i have the following error code:
Parse error: parse error in D:\xampp\htdocs\medocs\db_connection.php on line 3

May i know what went wrong.
Thanks for your time.
dennisl
 
Posts: 10
Joined: 06. July 2009 11:23

Re: unable to connect to database

Postby glitzi85 » 06. July 2009 11:37

dennisl wrote:db_conenction.php
Code: Select all
<? php
//Define database connection constants
define ('db_host', 'localhost');
define ('db_un', 'root');
define ('db_psw', '');
define ('db_name', 'medocs');
?>

There is a space between <? and php.

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: unable to connect to database

Postby dennisl » 09. July 2009 14:05

Thanks, it works now.

How careless I am.....
dennisl
 
Posts: 10
Joined: 06. July 2009 11:23


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 151 guests