I can imagine lots of reasons why this query fails, what exactly are you trying to achieve here? I don't think it's reasonable to try an fix this; there should be a much better way to do this.
First of all there probably will be a WHERE clause after that, like this: WHERE something_id=6;
I'm guessin you want to modify a specific row with a specific something_id(primary key).
Then you should use CONSTANTS not variables for the mysql_connect parameters. Why are you using quotes there anyway?
$conex = mysqli_connect($host, $username, $pass, $dbname); //Connection to db
// That $sql thingy, but this time done right
$upd = mysqli_query($conex, $sql); // the actual query sent to mysql
if ($upd) {echo 'Yay!'} // if you're just playing around and want to check if it worked though it should work ... but I'm quite new to PHP and I might have missed something somewhere out of hurry.
Hello!
Where is the end of the query?
codes here...
$host="localhost"; // Host name
$username="root"; // Mysql username
$password="1003"; // Mysql password
$db_name="registration"; // Database name
$tbl_name="cenrolled"; // Table name
$idsem = $_POST["idsem"];
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// update data in mysql database
$sql="UPDATE $tbl_name SET `tuitionfee` = 'tuitionfee',
`guidancefee` = 'guidancefee',
`lib_id_cardfee` = 'lib_id_cardfee',
`culturalartsfee` = 'culturalartsfee',
`libfee` = 'libfee',
`exservicesfee` = 'exservicesfee',
`schoolpaperfee` = 'schoolpaperfee',
`athleticsfee` = 'athleticsfee',
`avfee` = 'avfee',
`apscufee` = 'apscufee',
`charitablefee` = 'charitablefee',
`otherfee` = 'otherfee',
`medicalfee` = 'medicalfee',
`othercharge1remarks` = 'othercharge1remarks',
`othercharge1fee` = 'othercharge1fee',
`nstpfee` = 'nstpfee',
`othercharge2remarks` = 'othercharge2remarks',
`othercharge2fee` = 'othercharge2fee',
`registrationfee` = 'registrationfee',
`labfee` = 'labfee',
`totalfee` = 'totalfee',
`discountfee` = 'discountfee',
`otherlessremarks` = 'otherlessremarks',
`otherlessfee` = 'otherlessfee',
`netfee` = 'netfee',
`cash` = 'cash',
`orcash` = 'orcash',
`cashdate` = 'cashdate',
`grandtotalfee` = 'grandtotalfee',
`dpfee` = 'dpfee',
`ornumberdp` = 'ornumberdp',
`dpdate`