Hello, my mysqli_fetch_array(mysqi_query($db, $query))
doesn't appear to be getting the correct information from the database, and therefore, the PHP application is not working as it should.
Here are the queries,
<?php
if($_GET){
$current = mysqli_fetch_array(mysqli_query($db, "SELECT * from `tbl_user` WHERE `userid` = '".$_GET['userid']."'"));
$currentperms = mysqli_fetch_array(mysqli_query($db, "SELECT * from `tbl_perms` WHERE `userid` = '".$_GET['userid']."'"));
}
?>
Concurrently, the if ($current['userid'] == "1") {echo(" selected ");}
isn't outputting anything at all, so the correct option isn't selected in the SELECT tag.
So, where: I'd expect: echo($currentperms['newapp']); not to equal 1, becuase it is set so in the database, the result of which is "1". I have test this by echoing the string gained. Newapp is not a column in the table either, so it shouldn't be returning "1" as a result.
With this:
if $current['userid'] == "1") {
echo(" selected ");
}
Nothing is being echoed, however, the variable has been used in the script earlier, and the output of which is "1".
Please help me, I'm going through the roof :|
@sasa: output: Success!Array ( [0] => 1 [userid] => 1 [1] => shamil.nunhuck [username] => shamil.nunhuck [2] => Shamil Nunhuck [userfullname] => Shamil Nunhuck [3] => shamil.nunhuck@localhost [useremail] => shamil.nunhuck@localhost [4] => 6363d731bd7492fe4c33fc3d90fd61bc [userpassword] => 6363d731bd7492fe4c33fc3d90fd61bc [5] => 1 [userlevel] => 1 [6] => Administrator [usertitle] => Administrator [7] => 1 [tos] => 1 ) Array ( [0] => 1 [userid] => 1 [1] => 0 [ptodo] => 0 [2] => 0 [usercp] => 0 [3] => 0 [pm] => 0 [4] => 0 [bug] => 0 [5] => 0 [abug] => 0 [6] => 0 [admincp] => 0 [7] => 0 [intmgs] => 0 [8] => 0 [adduser] => 0 [9] => 0 [pass] => 0 [10] => 0 [useredit] => 0 [11] => 0 [listuser] => 0 [12] => 0 [newapp] => 0 )