Delete multiple database fields

Hi, I was wondering how to go about deleting multiple database fields.

[php]$this->sql->Delete(“DELETE fastpost1, fastpost2, fastpost3 FROM “.$this->TABLES[‘backup’].” WHERE date = ‘$date’”); [/php]

This brings back the error, unknown table ‘fastpost1’ in multi delete

The weird thing is, it used to work fine, but all of a sudden it made this error. :frowning:

You want to delete database fields or rows? What is your table structure and what are fastpost1, fastpost2, fastpost3?

CREATE TABLE IF NOT EXISTS backup (

id int(6) NOT NULL AUTO_INCREMENT,
date varchar(20) NOT NULL,
name varchar(20) NOT NULL,
fastpost1 varchar(20) NOT NULL,
fastpost2 varchar(20) NOT NULL,
fastpost3 varchar(20) NOT NULL,

PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=108 ;

I want to delete the information stored in fastpost1, 2 and 3 only. So not deleting the other fields, ID, Name, Date

I think that is not possible through DELETE query. Use “UPDATE” instead!

And just update as ‘’ blank

Yes exactly! :slight_smile:

Simple as that :slight_smile:
Interesting how DELETE can’t be more specific in its deleting

Because there’s vast difference in deleting something and updating something. If you “DELETE” something, it will get completely removed/erased while if you want something to stay there but make empty it’s value or make it “”, you need to UPDATE it’s current value to “” !!! :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service