<?php
require("setting.php");
$link = mysqli_connect($setting["host"],$setting["username"],$setting["password"],$setting["db"]);
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "update users set comment ='viewed' where id ='1'";
if ($result = mysqli_query($link, $query)) {
echo " Update OK ";
}
else {
printf(" failed: %s\n", mysqli_error($link));
}
mysqli_close($link);
?>
////Setting Sscript
<?php
//db conection settings
$setting=array("username"=>"root","password"=>"113","host"=>"127.0.0.1","db"=>"users");
?>
No hay comentarios:
Publicar un comentario