mysqli_query () erwartet Parameter 1 [duplizieren]
Diese Frage hat hier bereits eine Antwort:
mysql_fetch_array () / mysql_fetch_assoc () / mysql_fetch_row () / mysql_num_rows etc… erwartet, dass Parameter 1 eine Ressource oder ein Ergebnis ist 31 answersWarnung: mysqli_query () erwartet, dass Parameter 1 mysqli ist, die Ressource in C: \ xampp \ htdocs \ iapdone2_myprofile.php in Zeile 30. Warnung: mysqli_fetch_array () erwartet, dass Parameter 1 mysqli_result ist, null in C: \ xampp \ htdocs \ iapdone2_myprofile.php in Zeile 32 Hinweis: Undefinierter Index: Adresse in C: \ xampp \ htdocs \ 22_myprofile.php in Zeile 37 Hinweis: Undefinierter Index: Geschlecht in C: \ xampp \ htdocs \ 22_myprofile.php in Zeile 41
<html> <div id="myProfile">
<?php
if(($_SERVER["REQUEST_METHOD"] == "POST") and (isset($_POST['editProfile'])))
{
include 'opendatabase.php';
$updateUserDetails="UPDATE users SET email='".$_POST['email']."',address='".$_POST['address']."',gender='".$_POST['gender']."' WHERE username='".$_SESSION['ID']."'";
//mysqli_query($connection,$updateUserDetails) or die(mysqli_error($connection));
include 'closedatabase.php';
header("Refresh: 0; url=userProfile.php");
}//endif
?>
<h2>Personal Details</h2>
<hr/>
<form action="<?php echo 'userProfile.php';?>" method="POST" onsubmit="return profileValidation()" enctype="multipart/form-data">
<table id="profileDetails">
<tr>
<?php
include 'opendatabase.php';?>
<?php
$personalDetails="SELECT email,description,address,gender,join_date FROM users WHERE username='".$_SESSION['ID']."'";
$getPersonalDetails=mysqli_query($connection,$personalDetails);
$rowPersonalDetails=mysqli_fetch_array($getPersonalDetails);
if($rowPersonalDetails['email']==NULL)
{
$rowPersonalDetails['email']="-";
}
if($rowPersonalDetails['address']==NULL)
{
$rowPersonalDetails['address']="-";
}
if($rowPersonalDetails['gender']==NULL)
{
$rowPersonalDetails['gender']="-";
}
?>
</tr>
<tr>
<td>Username:</td>
<td><?php echo $_SESSION['ID'];?><hr/></td>
</tr>
<tr>
<td>Email:</td>
<td><?php echo $rowPersonalDetails['email'];?><hr/></td>
</tr>
<tr>
<td>Address:</td>
<td><?php echo $rowPersonalDetails['address'];?><hr/></td>
</tr>
<tr>
<td>Gender:</td>
<td><?php echo $rowPersonalDetails['gender'];?><hr/></td>
</tr>
<tr>
<td>Join Date:</td>
<td><?php echo $rowPersonalDetails['join_date'];?><hr/></td>
</tr>
<tr>
<td></td>
<td><input type="button" onclick="editProfile()" value="Edit"></td>
</tr>
</table>
</form>
</div>