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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:55:13+00:00 2026-05-14T19:55:13+00:00

public function create() { echo $this->equipment->getCatId() . <br/>; echo $this->equipment->getName() . <br/>; echo $this->equipment->getYear()

  • 0
public function create() {


        echo $this->equipment->getCatId() . "<br/>";
        echo $this->equipment->getName() . "<br/>";
        echo $this->equipment->getYear() . "<br/>";
        echo $this->equipment->getManufacturer() . "<br/>";
        echo $this->equipment->getModel() . "<br/>";
        echo $this->equipment->getPrice() . "<br/>";
        echo $this->equipment->getLocation() . "<br/>";
        echo $this->equipment->getCondition() . "<br/>";
        echo $this->equipment->getStockNum() . "<br/>";
        echo $this->equipment->getInformation() . "<br/>";
        echo $this->equipment->getDescription() . "<br/><br/>";


        $db = Connect::connect();
        $current_time = date('y M d');
        $query = "INSERT INTO equipment (cat_id, name, year, manufacturer, model, price, location, condition,
                                         stock_num, information, description, created, modified)

                                         VALUES

                                        ({$this->equipment->getCatId()}, {$this->equipment->getName()}, {$this->equipment->getYear()},
                                         {$this->equipment->getManufacturer()}, {$this->equipment->getModel()}, {$this->equipment->getPrice()},
                                         {$this->equipment->getLocation()}, {$this->equipment->getCondition()}, {$this->equipment->getStockNum()},
                                         {$this->equipment->getInformation()}, {$this->equipment->getDescription()}, '$current_time', '$current_time')";

        $result = $db->query($query);

        return $db->insert_id;

    }
  • The echos at the top all display valid data that fit the database schema.
  • There are no connection errors

Any ideas?

Thanks in advance!

Here is the echo’ed query

INSERT INTO equipment (cat_id, name, year, manufacturer, model, price, location, condition, stock_num, information, description, created, modified) VALUES (1, ‘r’, 1, ‘sdf’, ‘sdf’, ‘2’, ‘d’, ‘d’, ‘3’, ‘asdfasdfdf’, ‘df’, ’10 May 10′, ’10 May 10′)

MySQL is giving: #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘condition, stock_num, information, description, created, modified) VALUES (1, ‘r’ at line 1

id int(11) unsigned NO PRI NULL auto_increment
Edit Delete cat_id int(11) unsigned NO NULL
Edit Delete prod_name varchar(255) YES NULL
Edit Delete prod_year varchar(10) YES NULL
Edit Delete manufacturer varchar(255) YES NULL
Edit Delete model varchar(255) YES NULL
Edit Delete price varchar(10) YES NULL
Edit Delete location varchar(255) YES NULL
Edit Delete condition varchar(25) YES NULL
Edit Delete stock_num varchar(128) YES NULL
Edit Delete information text YES NULL
Edit Delete description text YES NULL
Edit Delete created varchar(20) YES NULL
Edit Delete modified varchar(20) YES NULL

Query: INSERT INTO equipment (cat_id, prod_name, prod_year, manufacturer, model, price, location, condition, stock_num, information, description, created, modified) VALUES (1, ‘asdf’, ‘234’, ‘adf’, ‘asdf’, ’34’, ‘asdf’, ‘asdf’, ‘234’, ‘asdf’, ‘asdf’, ’10 May 10′, ’10 May 10′)

Here is the SQL export from PhpMyAdmin in case someone wants to try duplicating this issue: http://pastie.org/954206

BLEHBLEHSDFOHSE — So apparently, ‘condition’ is also a reserved word… threw in some backticks, then it started working.

  • 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-14T19:55:13+00:00Added an answer on May 14, 2026 at 7:55 pm

    YEAR is a reserved word in MySQL. If you’re going to use it, you’re going to need to backtick (i.e. `year`)

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

Sidebar

Related Questions

i declared classes like this: class Foo{ public function __construct(){ echo 'Foo was created!';}
I have this method in my db class public function query($queryString) { if (!$this->_connected)
I'm trying to do this (which produces an unexpected T_VARIABLE error): public function createShipment($startZip,
In a webservice I see this code: <WebMethod()> _ Public Function dosomething() As Boolean
Let's say we have the following method declaration: Public Function MyMethod(ByVal param1 As Integer,
A little example TTest<T> = class private f : T; public function ToString :
Here is my function ( updated ): Public Shared Function shortenUrl(ByVal URL As String)
Consider the delegate for a generic A to B function: public delegate B Fun<A,
Let's say we have a method signature like public static function explodeDn($dn, array &$keys
Should the visibility for the __destruct() function be public or something else? I'm trying

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.