Connection problem

Reply

Join Date: Nov 2008
Posts: 13
Reputation: anumitadas is an unknown quantity at this point 
Solved Threads: 0
anumitadas anumitadas is offline Offline
Newbie Poster

Connection problem

 
0
  #1
Nov 22nd, 2008
<?php
<$conn=mysql_connect("localhost","root","root");
echo("connected");
if(!$conn)
{
die('could not connect:'.mysql_error());
}
mysql_select_db("student",$conn);
if (!mysql_select_db('student', $conn)) {
echo 'Could not select database';
exit;
}


?>

This the code..Using which I want to connect but getting the error:

Parse error: parse error in c:\apache\htdocs\phpmyadmin\connection.php on line 6


Plz help
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 24
Reputation: sasankasekhar is an unknown quantity at this point 
Solved Threads: 3
sasankasekhar's Avatar
sasankasekhar sasankasekhar is offline Offline
Newbie Poster

Re: Connection problem

 
0
  #2
Nov 22nd, 2008
Originally Posted by anumitadas View Post
<?php
<$conn=mysql_connect("localhost","root","root");
echo("connected");
if(!$conn)
{
die('could not connect:'.mysql_error());
}
mysql_select_db("student",$conn);
if (!mysql_select_db('student', $conn)) {
echo 'Could not select database';
exit;
}


?>

This the code..Using which I want to connect but getting the error:

Parse error: parse error in c:\apache\htdocs\phpmyadmin\connection.php on line 6


Plz help
Please check out the lines:
  1. <?php
  2. <$conn=mysql_connect("localhost","root","root");
  3. echo("connected"); ......

Please remove the "<" before $conn

Regards
IF SOMEONE FEELS THAT THEY HAD NEVER MADE A MISTAKE IN THEIR LIFE, THEN  IT MEANS THEY HAD NEVER TRIED A NEW THING IN THEIR LIFE
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC