- UPDATE collection SET image_name = 'collection_diir/1225542431.jpg',
-
Code = 'qqq',
-
Media = 'qqq',
-
Dimensions = 'qqq',
-
Availbility = 'qqq' WHERE
-
collection. image_id = '7' AND collection. image_name = `collection_dir/19521.jpg`
such SQL query is not work
Table Structure is as follow
Table structure for table `collection`
-- -
CREATE TABLE `collection` (
-
`artist_id` int(11) NOT NULL,
-
`image_id` int(11) NOT NULL auto_increment,
-
`image_name` varchar(100) NOT NULL,
-
`image_thumbs` varchar(100) NOT NULL,
-
`Code` varchar(100) NOT NULL,
-
`Media` varchar(100) NOT NULL,
-
`Dimensions` varchar(100) NOT NULL,
-
`Availbility` varchar(100) NOT NULL,
-
PRIMARY KEY (`image_id`)
-
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=17 ;
-
-
--
-
-- Dumping data for table `collection`
-
--
-
-
INSERT INTO `collection` (`artist_id`, `image_id`, `image_name`, `image_thumbs`, `Code`, `Media`, `Dimensions`, `Availbility`) VALUES
-
(5, 5, 'collection_dir/24528.jpg', 'collection_dir/thumbs/thumbs_1224932899.gif', '', '', '', ''),
-
(5, 6, 'collection_dir/24528.jpg', 'collection_dir/thumbs/thumbs_1224932971.gif', '', '', '', ''),
-
(5, 7, 'collection_diir/1225542431.jpg', 'collection_dir/thumbs/thumbs_1224933091.jpg', 'qqq', 'qqq', 'qqq', 'qqq'),
-
(5, 8, 'collection_dir/24528.jpg', 'collection_dir/thumbs/thumbs_1224933097.jpg', '', '', '', ''),
-
(6, 9, 'collection_dir/1225533128.jpg', 'collection_dir/thumbs/thumbs_1225533128.jpg', '', '', '', ''),
-
(6, 10, 'collection_dir/1225533133.jpg', 'collection_dir/thumbs/thumbs_1225533133.jpg', '', '', '', ''),
-
(6, 11, 'collection_dir/1225533138.jpg', 'collection_dir/thumbs/thumbs_1225533138.jpg', '', '', '', ''),
-
(7, 12, 'collection_dir/1225542399.jpg', 'collection_dir/thumbs/thumbs_1225542399.jpg', '', '', '', ''),
-
(7, 13, 'collection_dir/1225542406.jpg1', 'collection_dir/thumbs/thumbs_1225542406.jpg', '', '', '', ''),
-
(7, 14, 'collection_dir/19521.jpg', 'collection_dir/thumbs/thumbs_12255424114.jpg', 'aaa', 'aaa', 'aaa', 'aaaa'),
-
(7, 15, 'collection_dir/1225542421.jpg', 'collection_dir/thumbs/thumbs_1225542421.jpg', '', '', '', ''),
-
(7, 16, 'collection_dir/1225542431.jpg', 'collection_dir/thumbs/thumbs_1225542431.jpg', '', '', '', '');
-
Plz say me right solusiion
2 1307
This is pretty simple, replace ( ` ) with ( ' ) in your sql like this - UPDATE collection SET image_name = 'collection_diir/1225542431.jpg',
-
Code = 'qqq',
-
Media = 'qqq',
-
Dimensions = 'qqq',
-
Availbility = 'qqq'
-
WHERE
-
collection.image_id = '7' AND collection.image_name = 'collection_dir/19521.jpg'
Atli 5,058
Expert 4TB
Hi.
Your image_id is an integer, and as such, it's value should not be quoted. Only string values should be quoted.
That is; -
/* It should be */
-
UPDATE whatever WHERE image_id = 1;
-
/* NOT */
-
UPDATE whatever WHERE image_id = '1';
-
And both of you:
Please use [code] tags when posting your code examples. (See How to ask a question)
[code] ... Code goes here... [/code]
Thank you. Moderator Sign in to post your reply or Sign up for a free account.
Similar topics
by: Westcoast Sheri |
last post by:
To keep track of how many fruits my visitors buy, I use a mySQL database
(2 columns: "fruit" and "quantity")....so can we make these following
mySQL queries work somehow?
(visitor buys 5...
|
by: Simon |
last post by:
Hi,
We have a small utility that uses a database.
We are happy with the structure of the database but we cannot predict any
updates.
What we are particularly concerned about are updates vs....
|
by: Jeremiah Jacks |
last post by:
I just upgraded to MySQL 4.0.14-standard for RedHat Linux and am using =
the
pre-compiled binaries.
I have a database with INNODB tables.
When I insert a row into one of the child tables, I get...
|
by: Dan Jones |
last post by:
How do I update a table to remove orphaned references to a second
table? I've deleted rows in the second table, which has a unique
auto_increment key. The first table now has references to keys...
|
by: Michael Lauzon |
last post by:
This is not for a class, I have a group on SourceForge, this is what
one of the Developers is asking; the more advanced you can make it
right off all the better!:
Can someone please create...
|
by: John |
last post by:
I wanna update the table COMPANY from a linked field. The following is not
accepted. Could anybody help me with what the command should be?
Thanks a lot.
UPDATE `COMPANY`
SET...
|
by: fuimens |
last post by:
Hi,
With mysql-4.0.20, I have a problem inserting data with foreign key
references, MySQL saying ERROR 1216: Cannot add or update a child row:
a foreign key constraint fails
The message is...
|
by: UKuser |
last post by:
Hi Guys,
I am trying to create an editable table of a MySQL query where every
field can be updated. My example script is at:
http://nana46.coconia.net/test4.php however I am currently getting...
|
by: Jon Maz |
last post by:
Hi,
I have a MySql problem I hope someone can help me with. I'm trying to run
an update on a linking table, the update is running into a Primary Key
constraint violation, and in my workaround...
|
by: cwho.work |
last post by:
Hi!
We are using apache ibatis with our MySQL 5.0 database (using innodb
tables), in our web application running on Tomcat 5. Recently we
started getting a number of errors relating to...
|
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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
| |