I'm making a website to connect to MySQL, but I've this function to update a SQL column in php:
<?php
function insert_db($table, $id, $value, $id2, $value2){
$con = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database);
if ($db_found){
mysql_query(" UPDATE ".$table." SET ".$id."='".$value."' WHERE ".$id2." = '".$value2."'); //this doesn't work!
mysql_close($con);
}
else {
print "Database not found!";
mysql_close($con);
}
}
?>
But this function doesn't work! Please help me! And is there a better way of doing this instead of "mysql_query()"?