Kate's Code Derps

Even if you KNOW you will only get a single value from a single row in a keyed selection statement (SELECT id FROM), you will not get just that column value, you get an array from whence you get your variable.

For example:

if ($result = $mysqli->query($query)) {

            $query_row = mysqli_fetch_assoc($result);

            $userID = $query_row[‘id’];
        }

The mysqli_fetch_assoc returns an array with the column name and the value, and you access the value accordingly. There is no way to just get value! (That’s the derp here, for me.)

View original post

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s