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 8661801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:35:08+00:00 2026-06-12T16:35:08+00:00

I am trying to update a table row using the below code t.executeSql(‘UPDATE flatcomments

  • 0

I am trying to update a table row using the below code

t.executeSql('UPDATE flatcomments SET BuildingCode = ?, FlatNo = ?, Comment = ?, Closed = ?, New = ?)', 
[buildingcode, flatdescription, flatcomment.toUpperCase(), 1, 1]);

with no success. Where am i wrong

  • 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-06-12T16:35:09+00:00Added an answer on June 12, 2026 at 4:35 pm

    This is a nice PHP tutorial.
    All SQLite commands will work for you.

    <?php
    
    # CREATING A TABLE
    $dbname = 'base';
    $mytable ="tablename";
    
    $base= new SQLiteDatabase($dbname, 0666, $err);
    if ($err)  exit($err);
    
    $query = "CREATE TABLE $mytable(
                ID bigint(20) NOT NULL PRIMARY KEY,
                post_author bigint(20) NOT NULL,            
                post_date datetime,
                post_content longtext,
                post_title text,
                guid VARCHAR(255)            
                )";
    
    $results = $base->queryexec($query);
    # The SQL command CREATE TABLE defines the columns. It is sent to the SQLite manager by the PHP method queryExec() which returns true or false, depending on whether the operation is successful or not.
    
    # See the code of the script sqlite-create-table.php.
    
    
    
    # ADDING POSTS
    
    # The table of posts that we just created will be filled, like in WordPress, with the posts we write, each post corresponding to a row of the table.
    # The SQL command: INSERT INTO allows to store the data.
    $number = 1;
    $title="My first post";
    $content="The content of my post...";
    $date = strftime( "%b %d %Y %H:%M", time());
    $author=1;
    $url = "http://www.lantian.eu";
    
    $query = "INSERT INTO $mytable(ID, post_title, post_content, post_author, post_date, guid) 
                    VALUES ('$number', '$title', '$content', '$author', '$date', '$url')";
    $results = $base->queryexec($query);
    # For the purposes of the tutorial, we place the contents of the post directly into variables. In practice these variables will be assigned from an t online or local ext editor, as shown in the CMS tutorial.
    # The author is represented by the number 1 because WordPress does not put the names in the posts table but in a separate table instead.
    # The guid column contains the URL of the post that also serves as an ID unique.
    # The INSERT command jas for first parameter the table name and in parentheses the list of columns to fill, then the parameter VALUE provides a list of values corresponding to the columns in the same order.
    # Thus, post_title, which contains the titles, will has for value $title, the variable that was assigned the title of the post.
    # The same queryExec method is used to send the request.
    
    # Source code of the script sqlite-write.php.
    
    
    
    # READING A POST
    # You can access the contents of the database with the SELECT command.
    $query = "SELECT post_title, post_content, post_author, post_date, guid FROM $mytable";
    $results = $base->arrayQuery($query, SQLITE_ASSOC);
    $arr = $results[0];
    
    if($results)
    {
       $title = $arr['post_title'];
       $content = $arr['post_content']; 
       $user = $arr['post_author'];
       $date = $arr['post_date'];
       $url = $arr['guid'];
    }     
    # To the SELECT command is given the list of columns that you want get the content and lines will be assigned to $results array. Indeed, the arrayQuery PHP method returns an array of arrays, each representing a line of the table.
    # In practice we will use instead other commands that we will see later to limit the resources usage.
    # Data are retrieved in the associative array $arr, where the column names are keys and their content the values.
    
    # Source code of the script sqlite-read.php.
    
    
    # DELETING A TABLE
    # The deletion of a table is made by the DROP TABLE command of SQL.
    $query = "DROP TABLE $mytable";
    $results = $base->queryexec($query);
    
    # See the code sqlite-delete-table.php.
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run the following query using phpMyAdmin: UPDATE TABLE x SET `number`
i was trying to update a table row by row in postgresql using python.
I'm trying to do a single row insert/update on a table but all the
Im trying to update a table with the following code. If I change WHERE
I'm trying to update a table in my DynamoDB tables using the PHP SDK.
I'm trying to update a thousand or so rows in a DB2 table using
I am trying to highlight a table row using Jquery's .hover() method. I have
I'm trying to delete a row from a table in MySQL using the PHP
i am trying to allow users to update their profile picture using this code.
I'm currently trying to update a row using the sqlitedatabase.update method here: Heres the

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.