Joined: Tue Aug 09, 2011 12:50 pm Posts: 7 Has thanked: 0 time Have thanks: 0 time
hi all i have been inserting records in to database using php using the below program which is saved as "insert.php". but it is displaying the following error Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\insert1.php on line 18
dont no what went wrong. can u tell me how to solve it.....
Code:
<?php $host="localhost";// Host name $username="root";// Mysql username $password="";// Mysql password $db_name="test";// Database name $tbl_name="emp";// Table name
// Connect to server and select databse. mysql_connect("$host","$username","$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB");
$sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql);