0

<?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

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by sasankasekhar
0

<?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
<$conn=mysql_connect("localhost","root","root");
echo("connected"); ......

Please remove the "<" before $conn

Regards

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.