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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.