Home:ALL Converter>PHP Errorcode: expects parameter 1 to be mysqli

PHP Errorcode: expects parameter 1 to be mysqli

Ask Time:2016-03-22T07:46:15         Author:Sonny-Fifu

Json Formatter

i try build an app where u register you in a mysqli db from your own android device. I get many warnings at my php script.

Warning: mysqli_prepare() expects parameter 1 to be mysqli, boolean given in /home/a3074158/public_html/Register.php on line 12 Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, null given in /home/a3074158/public_html/Register.php on line 13 Warning: mysqli_stmt_execute() expects parameter 1 to be mysqli_stmt, null given in /home/a3074158/public_html/Register.php on line 14 Warning: mysqli_stmt_close() expects parameter 1 to be mysqli_stmt, null given in /home/a3074158/public_html/Register.php on line 16 Warning: mysqli_close() expects parameter 1 to be mysqli, null given in /home/a3074158/public_html/Register.php on line 19

there ist my code

<?php 
$connect = mysqli_connect("localhost", "my_user", "my_password", "my_db");

if ($conn->connect_error) {
die("Verbindung fehlgeschlagen: " . $connect->connect_error);
}
$name= $_Post["name"];
$alter= $_Post["alter"];
$passwort= $_Post["passwort"];
$username= $_Post["username"];

$statement = mysqli_prepare($connect, "Insert into User (name, alter, username, passwort) VALUe(?, ?, ?, ?)");
mysqli_stmt_bind_param($statement,"siss", $user, $alter, $username, $passwort);
mysqli_stmt_execute($statement);

mysqli_stmt_close($statement);  


mysqli_close($connect);

?>

Its my first try, any ideas/tips/tutorials?

Author:Sonny-Fifu,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/36143747/php-errorcode-expects-parameter-1-to-be-mysqli
yy