Error: 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 'desc) VALUES (?,?)' at line 1
Syntax: - INSERT INTO equip_type (name, desc) VALUES (?,?)
Other Syntax on my program that works: - INSERT INTO equipment (name,purchasedate,purchaseprice,type,lastrepair,serial,usagetype,usageval,brand,dateadded,notes) VALUES (?,?,?,?,?,?,?,?,?,?,?)
I can't see the problem... Any help?
Throw some back ticks around desc and try again. DESC is a reserved word.
Here is a link if you want some more information on reserved words/keywords in mysql: MySQL Reserved Words 3 2277
Throw some back ticks around desc and try again. DESC is a reserved word.
Here is a link if you want some more information on reserved words/keywords in mysql: MySQL Reserved Words
you have to check your spelling and desc table again .. make sure everything is correct spelling in table's structure
Second statement is fine.. First having issue because you are using "desc" as column name. It is not possible as "desc" is reserved key word for sorting a column.. create table that having column name as "name" and "description". Then insert into that.. :)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: yzzzzz |
last post by:
Hi,
I am compiling PHP 5.0.2 myself with MySQL support.
I did a ./configure --with-mysqli=/usr/local/mysql/bin/mysql_config
(see end of post for complete configure)
Note: I also have...
|
by: Reestit Mutton |
last post by:
I'm trying to get the mysqli object-oriented syntax to work in php. I
understand that I have to have at least version 5 of php - I've
therefore opted for version 5.1.4. The remainder of my setup is...
|
by: Dodger |
last post by:
Okay, background... yes, I am another of those evil, spurned, damnable
Perl mongers, but I'm not trying to start a flamewar, I'm juust tryung
to understand something...
I can write a script in...
|
by: davids58 |
last post by:
trying to figure out how to use a mysql database with PHP. I ran the
following code:
<?php
// defines database connection data
define('DB_HOST', 'localhost');
define('DB_USER', 'ajaxuser');...
|
by: Curtis |
last post by:
Hello everyone:
Recently, I decided to upgrade to PHP 5.2.0. I have C:\php5 in the
Windows XP PATH, so upgrading is quite painless; just unzip new
release, and restart Apache! Usually it goes...
|
by: Schmidty |
last post by:
If you do a page reload with $_SERVER will your program
lose a mysqli connection upon the reload of the page? Would this code
work? I need to know how to carry over a connection between methods as...
|
by: Daz |
last post by:
Hi everyone.
I am trying to create an extension of the mysqli class within PHP, and
I am finding it quite difficult. I am fairly new to PHP classes, and
decided to give them a go. Here's what I...
|
by: Michael |
last post by:
Hi,
I try to use mysqli object instead of standard mysql functions.
Is it ok to create mysqli object within my class or schould I pass
mysqli object to my object.
The problem is, with code...
|
by: Taras_96 |
last post by:
Hi everyone,
I'm trying to run a number of commands stored within a sql file from
within php using mysqli::query. The syntax I'm using is:
source C:\data\projects\forum...
|
by: Tuyet |
last post by:
I am attempting to connect to the database (which was successfully). However, I can not extend the connection to execute other functions. In my example below,
the output is not giving me what I...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |