- Joined
- Jun 1, 2018
- Posts
- 157
- Reaction
- 454
- Points
- 203
- Age
- 30
Fatal error: Uncaught ArgumentCountError: mysqli_query() expects at least 2 arguments, 1 given in C:\xampp\htdocs\SCESGS\create_account.php:39 Stack trace: #0 C:\xampp\htdocs\SCESGS\create_account.php(39): mysqli_query('INSERT INTO acc...') #1 {main} thrown in C:\xampp\htdocs\SCESGS\create_account.php on line 39
code
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg") {
echo "<script>alert('PNG, JPG, and JPEG are allowed!')</script>";
} else {
$image= addslashes(file_get_contents($_FILES['image']['tmp_name']));
$image_name= addslashes($_FILES['image']['name']);
move_uploaded_file($_FILES["image"]["tmp_name"], $dir . $_FILES["image"]["name"]);
$query = "INSERT INTO accounts(id,firstname,lastname,username,password,picture,usertype) VALUES (null,'".$firstname."','".$lastname."','".$username."','".$password."','".$picture."','".$usertype."')";
mysql_query($query);
echo "<script>alert('Data Successfully Saved!')</script>";
echo '<script>windows: location="view_accounts.php"</script>';
}
code
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg") {
echo "<script>alert('PNG, JPG, and JPEG are allowed!')</script>";
} else {
$image= addslashes(file_get_contents($_FILES['image']['tmp_name']));
$image_name= addslashes($_FILES['image']['name']);
move_uploaded_file($_FILES["image"]["tmp_name"], $dir . $_FILES["image"]["name"]);
$query = "INSERT INTO accounts(id,firstname,lastname,username,password,picture,usertype) VALUES (null,'".$firstname."','".$lastname."','".$username."','".$password."','".$picture."','".$usertype."')";
mysql_query($query);
echo "<script>alert('Data Successfully Saved!')</script>";
echo '<script>windows: location="view_accounts.php"</script>';
}