943,807 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 459
  • PHP RSS
Nov 22nd, 2008
0

Connection problem

Expand 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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
anumitadas is offline Offline
17 posts
since Nov 2008
Nov 22nd, 2008
0

Re: Connection problem

Click to Expand / Collapse  Quote originally posted by anumitadas ...
<?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:
PHP Syntax (Toggle Plain Text)
  1. <?php
  2. <$conn=mysql_connect("localhost","root","root");
  3. echo("connected"); ......

Please remove the "<" before $conn

Regards
Reputation Points: 10
Solved Threads: 3
Newbie Poster
sasankasekhar is offline Offline
24 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Php Hurdle
Next Thread in PHP Forum Timeline: How to pass information to child processes





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC