User Profile

Collapse

Profile Sidebar

Collapse
javedna
javedna
Last Activity: Apr 22 '07, 04:47 PM
Joined: Mar 1 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • javedna
    replied to Simple questionnaire validation problem
    in PHP
    Thanks very much again for your help,

    I've tried toe code you suggested but unfortunately it still outputs the same problem as my own code, I tried the following code:

    [PHP] // Validate the The Insertion of all answers -- check that they dont equal NULL

    // Query all the answers
    $check_answers = "SELECT question_id FROM questions as qid ORDER BY question_id ASC";

    ...
    See more | Go to post

    Leave a comment:


  • javedna
    replied to Simple questionnaire validation problem
    in PHP
    Again thank you for replying, What do you recommend?, I believe as I am declaring the variable locally inside the if statement it is not considered in the else part. I have tried declaring it outside but it doesnt seem to help!

    Nabz...
    See more | Go to post

    Leave a comment:


  • javedna
    replied to Simple questionnaire validation problem
    in PHP
    Firstly thanks for replying, Secondly it does work it for some reason in the error message it states the qid inside the item is undefined. This is only for the else part of my statement and not any other which is strange.

    My questionnaire is meant to be dynamic hence the reason for calling the array of answers known as $item the qid inside of this uniquely identifies each answer to each question it works for the submit perfectly...
    See more | Go to post

    Leave a comment:


  • javedna
    started a topic Simple questionnaire validation problem
    in PHP

    Simple questionnaire validation problem

    Hi

    guys Ive got a simple problem, im designing an online questionnaire and on submission the coding that I have used to validate whether a user has filled in all the questions is supposed to identify any questions they have missed out and print out a simple error message.

    It correctly identify which questions have not been filled in but returns the following error message too:


    .
    .
    ...
    See more | Go to post

  • javedna
    replied to Multiple MYSQL INSERT statement
    Cheers mate

    That worked like a charm

    Thanks

    Nabz...
    See more | Go to post

    Leave a comment:


  • javedna
    replied to arrays and for loop problems
    in PHP
    Hi thanks for the reply Ive tried that previously and once again and although no error message comes up nothing gets inserted into the table.

    [PHP]The following is the code ive used:

    if (isset($_POST['answers']) && is_array($_POST['answers']))
    {
    foreach($_POST['answers'] as $user_answers){

    echo "Value: $user_answers<b r>\n";

    if (isset($_POST['question'])...
    See more | Go to post

    Leave a comment:


  • javedna
    started a topic Multiple MYSQL INSERT statement

    Multiple MYSQL INSERT statement

    Hi Im doing a questionnaire in PHP and MYSQL

    I am trying to do a multiple insert using the following code

    [PHP]$query1 = "INSERT INTO answers (answer_score,q uestion_id,user _id) VALUES ('$item1','$que stion[0]','$user_id_for eign'), ('$item2','$que stion[1]','$user_id_for eign')";[/PHP]

    But it will only insert the first value and not the second. I have tested the mysql bit of coding in mysql itself...
    See more | Go to post

  • javedna
    replied to arrays and for loop problems
    in PHP
    Hi thanks again for replying Ive tried the code you suggested but its still not inserting all the answers I still get the following:

    Value: 7
    The Answer did not submit: Query was emptyValue: 7
    The Answer did not submit: Query was emptyValue: 7
    The Answer did not submit: Query was emptyValue: 7
    The Answer did not submit: Query was emptyValue: 7
    The Answer did not submit: Query was emptyValue: 7...
    See more | Go to post

    Leave a comment:


  • javedna
    replied to arrays and for loop problems
    in PHP
    Cheers for your help mate I gave it a go but unfortunately still cant get it to collect all the answers except the first string.

    [PHP]$answer = array();
    $answer[0] = $item1;
    $answer[1] = $item2;
    $answer[2] = $item3;
    $answer[3] = $item4;
    $answer[4] = $item5;
    $answer[5] = $item6;

    $numElements = count($answer); //this counts the elements
    for ($i = 0; $i < $numElements;...
    See more | Go to post

    Leave a comment:


  • javedna
    replied to arrays and for loop problems
    in PHP
    Hi guys thank you both for replying I want to individually store each string value in the database as an individual answer. (answers range from 0 to 7)

    The flollowing code is where how im printing my questionnaire on screen

    [PHP]//Fetch and print the questionnaire.
    $counter = 1;
    while ($row = mysql_fetch_arr ay($result,MYSQ L_BOTH)) {
    echo '<tr><td align="left">'. $counter....
    See more | Go to post

    Leave a comment:


  • javedna
    started a topic arrays and for loop problems
    in PHP

    arrays and for loop problems

    Hi there guys

    Im having a bit of a problem storing the values of some strings called $item1 ...$item6 (they are numbers from a radio button in a questionnaire, each item represents an answer for each question)

    I want to put them in an array so when I use a For Loop I can whiz through them and put them into a variable which can then be put into an insert statement in mysql. (The MYSQL is looped depending on how many...
    See more | Go to post

  • Looping a MYSQL INSERT statement for a questionnaire tools answers

    Can PHP help with the following as I have tried in the MYSQL Forums and cant get any help

    Thanks

    Nabz
    ----------------------------------------
    Hi I am developing a PHP MYSQL questionnaire tool.

    The problem I am having is that of inserting all the answers into the table. The questionnaire is Dynamic so the number of questions can vary. I have a variable that counts them so at the moment there...
    See more | Go to post
No activity results to display
Show More
Working...