lundi 4 juillet 2016

mysqli_fetch_assoc inquiry [duplicate]

This question already has an answer here:

I have a problem, and I can't really figure out what to do after reading documentation. Right now i'm making a quizz app for fun. Heres my PHP code. The error lies in $question. Which I want to be an associative array of the actual query itself. I'm wondering how I can achieve what I want, because I feel like i've done something similar in the past but I just can't remember how

<?php include 'database.php'; ?>'
<?php

    // Set question number
    $number = (int) $_GET['n'];

    $query = "SELECT * FROM 'questions'";
    $query.= "WHERE question_number = $number";
    $result = mysqli_query($connection,$query);
    $question = mysqli_fetch_assoc($result);


?>

Aucun commentaire:

Enregistrer un commentaire