sabecs
asked on
Need to add a forward slash "/" to all image fields in MySQL table?
Hi,
I need to add a forward slash "/" to all image fields in MySQL table only where they don't already exits.
Is there an easy way to do this?
Thanks in advance for your help.
I need to add a forward slash "/" to all image fields in MySQL table only where they don't already exits.
Is there an easy way to do this?
Thanks in advance for your help.
CREATE TABLE IF NOT EXISTS `items_test` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`image1` varchar(60) DEFAULT '/uploads/nopic.jpg',
`image2` varchar(60) DEFAULT '/uploads/nopic.jpg',
`image3` varchar(60) DEFAULT '/uploads/nopic.jpg',
`image4` varchar(60) DEFAULT '/uploads/nopic.jpg',
`image5` varchar(250) DEFAULT '/uploads/nopic.jpg',
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1151 ;
INSERT INTO `items_test` (`id`, `image1`, `image2`, `image3`, `image4`, `image5`) VALUES
(802, 'uploads/item802_1.jpg', 'uploads/nopic.jpg', 'uploads/nopic.jpg', 'uploads/nopic.jpg', 'uploads/nopic.jpg'),
(802, '/uploads/products_good.jpg', '/uploads/products_good2.jpg', 'uploads/nopic.jpg', 'uploads/nopic.jpg', 'uploads/nopic.jpg'),
(891, 'uploads/new_image_1.jpg', 'uploads/nopic.jpg', 'uploads/nopic.jpg', 'uploads/nopic.jpg', 'uploads/nopic.jpg');
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Gary, very much appreciated.
Open in new window