Postingan lainnya
Recoverable fatal error: object of class mysqli could not be converted to string di form login?
<?php
$conn = mysqli_connect( $host, $user, $pass) or die('Could not connect to mysqli server.' );
include ("_db.php");
?>
<form id="loginform" action="index.php?login_attempt=1" method="post">
<p class="animate4 bounceIn"><input type="text" id="username" name="username" placeholder="Username" /></p>
<p class="animate5 bounceIn"><input type="password" id="password" name="password" placeholder="Password" /></p>
<p class="animate6 bounceIn"><button class="btn btn-default btn-block">Masuk</button></p>
</form>
<?php
if(isset($_GET['login_attempt']))
{
$spf=sprintf($conn,"Select * from user_login");
$result=mysqli_query($conn,$spf);
$rw=mysqli_fetch_array($result);
var_dump($result);
$rc=mysqli_num_rows($result);
$user_login=$rc[0];
if($rc==1)
{
$_SESSION['login_hash']=$rw['login_hash'];
$_SESSION['login_user']=$rw['username'];
echo "<script>window.location='dashboard.php'</script>";
}
}
?>
C:\xampp\htdocs\inventory-ptgps\login.php on line 14. Line 14 itu yg $spf
0
1 Jawaban:
Jawaban Terpilih
sprintf kegunaannya untuk dijadikan string seperti errornya: object of class mysqli could not be converted to string kamu mau mengubah object class mysqli ke string, ini tidak bisa
0