Tuesday, 1 August 2017

php - Uncaught Error: Call to a member function fetch_assoc() on boolean

Im trying to learn php
Im using php 7.0.1
Im using php mysqli
I saw a lot of problem like this but their solutions doesnt help me i think its because im using latest version and others uses previous version
heres my php script:



session_start();
require_once '../../../db_connect.php';

$result = $db->query("select * from student where id = 1");


$personalinformation = $result->fetch_assoc();
echo $personalinformation['username'];
?>


heres my student table:



id | username | password
1 | user1 | pass1

2 | user2 | pass2
3 | user3 | pass3

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...