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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:39:32+00:00 2026-05-27T20:39:32+00:00

I have a strange thing over here. I’m trying to insert a value in

  • 0

I have a strange thing over here. I’m trying to insert a value in my database but it’s not working for some reason. I have this code:

PHP:

<input type='file' name='images[]' />
<input type="text" name="newproject_name" id="tags"/>
<input type='text' name='order[]' value='$b' />

$project            = new Project();
$project->photo     = $_FILES['images']['name'][$key];
$project->order     = $_POST['order'][$key];            
$projectnaam        = $_POST['newproject_name'];

if($project->createProject($_DB)) {
    echo "OK";
} else {
    echo "NOT OK";
}
                                }

FUNCTION:

class Project {
    public function createProject($db) {
        $sql = "INSERT INTO tblProject (
            project,
            photo,
            order)    // If you remove this line, the function is working
        VALUES(
            '".$db->escape($this->project)."',
            '".$db->escape($this->photo)."',
            '".$db->escape($this->order)."'    // If you remove this line, the function is working
            )";
        return $db->insert($sql);
    }
}

Strange thing is, when I delete the order-lines, the function is working just fine. I really don’t know what I’m doing 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-05-27T20:39:33+00:00Added an answer on May 27, 2026 at 8:39 pm

    ORDER is a reserved word. If you use backticks around the column name you should be good:

        $sql = "INSERT INTO tblProject (
            `project`,
            `photo`,
            `order`)    
        VALUES(
            '".$db->escape($this->project)."',
            '".$db->escape($this->photo)."',
            '".$db->escape($this->order)."'  
            )";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange timeout error, but I'm not sure how to debug it.
I have a strange thing here. I'm concatenating _bstr_t strings in order to assemble
I have a kind of strange thing that I really nead for my text
I have the following query, now the strange thing is if I run this
Seeing some strange things; help is being solicited. I have a query, like so:
I tried to draw a model with 197 polygons but i have strange black
I have a strange issue: I am using SPContext.Current.Web in a .aspx page, but
Here's a strange question for you guys, I have a nice sorted list that
I have some Ajax that has been working on a live site, now it
I have been trying to create a web service out some python scripts, and

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.