lundi 20 avril 2015

PHP Questionnaire using mysql

I am creating a PHP questionnaire to gather feedback from users, input on the form is a variety of textbox and radio buttons. My webpage is now retrieving the questions from the database (questions table) but i need to find a way to allow entry fields in-between questions to store users answers in my 'answers' table.

Here is the code i have thus far

<?php 
    include('Connections/test.php');

    $sql = "SELECT * FROM `questions` WHERE `questionnaire_id`=1;";

    $result = mysql_query($sql);

    while($question = mysql_fetch_array($result)) {

        echo"<p>". $question['question_body']."</p>";

    }
?>

This obviously just shows the questions i have stored in the database so i need to find out how to put a form for entry fields in here.

Thanks :)

Aucun commentaire:

Enregistrer un commentaire