cluce Posted June 9, 2008 Share Posted June 9, 2008 Can someone help me fix my errors? Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\www\vhosts\reagan\empInfo.php5 on line 19 Notice: Undefined index: update in C:\www\vhosts\reagan\empInfo.php5 on line 134 here is my cod below: <?php //create query and retrieve record of user logged on //create and issue the query $SQL = "SELECT username, first_name, last_name, address, city, state, zip, phone, altphone, email, company, DATE_FORMAT(last_login, '%b %e %Y at %r') aS last_login FROM auth_users WHERE username = '".$_SESSION['identity']."'"; $result = mysqli_query($mysqli,$SQL); $row = mysqli_fetch_array($result); echo "<strong>Username:</strong> "."<font color='blue'>".$row['username']."</font>"; echo "<br />"; echo "<strong>Full name:</strong> "."<font color='blue'>".$row['first_name'] . " " . $row['last_name']."</font>"; echo "<br />"; echo "<strong>Address:</strong> "."<font color='blue'>".$row['address']."</font>"; echo "<br />"; echo "<strong>City:</strong> "."<font color='blue'>".$row['city']."</font>"; echo "<br />"; echo "<strong>State:</strong> "."<font color='blue'>".$row['state']."</font>"; echo "<br />"; echo "<strong>Zip:</strong> "."<font color='blue'>".$row['zip']."</font>"; echo "<br />"; echo "<strong>Phone Number:</strong> "."<font color='blue'>".$row['phone']."</font>"; echo "<br />"; echo "<strong>Alternate Phone Number:</strong> "."<font color='blue'>".$row['Altphone']."</font>"; echo "<br />"; echo "<strong>Email:</strong> "."<font color='blue'>".$row['email']."</font>"; echo "<br />"; echo "<strong>Company:</strong> "."<font color='blue'>".$row['company']."</font>"; echo "<br />"; echo "<strong>Last successful login:</strong> "."<font color='blue'>".$row['last_login']."</font>"; echo "<br />"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/109423-solved-php-error/ Share on other sites More sharing options...
.josh Posted June 9, 2008 Share Posted June 9, 2008 The problem is that your query failed, so it returned FALSE (a boolean). Where is your script that connects to your database? The second error is a result of the first error, in that since $row failed to be assigned, it's not an array and therefore has no indexes. Quote Link to comment https://forums.phpfreaks.com/topic/109423-solved-php-error/#findComment-561272 Share on other sites More sharing options...
NorthWestSimulations Posted June 9, 2008 Share Posted June 9, 2008 Do you exactly have to use MySQLi? Try just MySQL Syntaxes Quote Link to comment https://forums.phpfreaks.com/topic/109423-solved-php-error/#findComment-561288 Share on other sites More sharing options...
cluce Posted June 9, 2008 Author Share Posted June 9, 2008 I fixed this. thanks for the help. I was using the wrong table. because I had dropped this table in my database and appended those fields in one table. Quote Link to comment https://forums.phpfreaks.com/topic/109423-solved-php-error/#findComment-561289 Share on other sites More sharing options...
cluce Posted June 9, 2008 Author Share Posted June 9, 2008 sorry but i cant seem to find the solve link. ist been awhile since I have been on here. Quote Link to comment https://forums.phpfreaks.com/topic/109423-solved-php-error/#findComment-561292 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.