Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3226604
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:28:34+00:00 2026-05-17T16:28:34+00:00

I’m using the PHP script below for an experiment I am conducting, however it

  • 0

I’m using the PHP script below for an experiment I am conducting, however it seems to error out with the error message: “Unknown column ‘time_submit109’ in ‘field list'” when it gets to the digit span task (around page 110). How do I resolve this error (I’m not well versed in PHP so I’m having a hard time debugging this). I think the error is related to the time_submit1 variable.

   <?php
//counter for dynamic timestamp and next_page
$counter_page = ++$counter+1;

//connect to db server
mysql_connect($host,$user,$password) or die('Unable to connect to database server<br>'.mysql_error());

    //if this is the first page of a survey
    if (!isset ($identification)) 
    //create db, if not already there
    {
    mysql_query("CREATE DATABASE IF NOT EXISTS $database"); 
    }

//select db
mysql_select_db($database) or die('Unable to select database<br>'.mysql_error());

    if (!isset ($identification)) 
    {
    //create table, if not already there
    mysql_query ("CREATE TABLE $table (identification int(9) NOT NULL auto_increment, 
    page1 TEXT, participation_date DATE, time_submit1 VARCHAR(8), ip_number VARCHAR(15), 
    browser TINYTEXT, PRIMARY KEY (identification)) TYPE=MyISAM");
    }

        //change array, so that time_submit and page are renamed dynamically
        foreach($variablen as $name=>$value)
        { 
            if ($name == "next_page") 
            { 
            $name = "page".$counter_page; 
            }
            elseif ($name == "counter") 
            {
            $name = "time_submit".$counter; 
            $value = date("G:i:s"); 
            }
        $newarray2[$name]=$value; 
        } 

    $variablen = $newarray2; 

        //for each line in the array of submitted variables do the following (traverse array)
        foreach($variablen as $name=>$value) 
        {    
        //modify table step by step (add colums according to html input)
        mysql_query ("ALTER TABLE $table ADD $name VARCHAR(255)");
         }

        if (!isset ($identification))         
        {
        //insert new record into db table (into the referer field) and thus generate identifcation (new record)
        mysql_query("INSERT INTO $table (page1, participation_date, time_submit1, ip_number, browser) 
        VALUES ('$referer', '".date("Y-m-d")."', '".date("G:i:s")."', 
        '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['HTTP_USER_AGENT']."')")or die('Unable to insert into table!<br>'.mysql_error()); 
        //grab last value of auto-increment variable "identification" to be used as identifier
        $identification = mysql_insert_id(); 
        }

        //for each line in the array of submitted variables do the following
        foreach($variablen as $name=>$value)     
        {
        //update db table step by step
        mysql_query("UPDATE $table SET $name='".mysql_real_escape_string($value)."' WHERE identification=$identification") or die('Unable to update table1<br>'.mysql_error()); 
        }

    //close connection
    mysql_close();

    //if this is the last html page: feedback for the participant
    if (!isset ($next_page)) 
    {
    echo $thank_you_text; 
    }

    //if questionnaire consists of still another html page
    else
    { 
    //call up next HTML page and pass on ID and counter
    echo "<html><head></head><body onLoad=\"javascript:location.replace('".$next_page."?op56=".$identification."&nr93=".$counter."')\">
    <a href=\"".$next_page."?op56=".$identification."&nr93=".$counter."\">Next Page</a></body></html>"; 
    //manual forwarding
    //echo "<html><head></head><body><a href=\"".$next_page."?op56=".$identification."&nr93=".$counter."\">Next Page</a></body></html>"; 
    }
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:28:35+00:00Added an answer on May 17, 2026 at 4:28 pm

    Not really a solution but the problem is pointing out to the fact that you are referencing a field name that is not part of the table. Check the arrays and make sure that the field names do exist in the tables

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Does anyone know how can I replace this 2 symbol below from the string
I'm making a simple page using Google Maps API 3. My first. One marker
I want use html5's new tag to play a wav file (currently only supported
In order to apply a triggered animation to all ToolTip s in my app,
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.