Hello althouh i delete records from the database when i call them on a query they appear. Not the other records of the data just the id i have already deleted. I dont use WHERE because i want to return all records from table. Any guess why the id is returned although it's been deleted?

Recommended Answers

All 7 Replies

What is the query that you are using to delete the record? Are you not in a transaction that is cancelled and rolled back? Some background info (queries) would not be misplaced here :).

I deleted it from the database manually. is it possible to show empty records if the id its a foreign key on another table?

I don't think I fully understand your question. Could you give us some more background info? Like the table structure and the queries you are using? :)

Member Avatar for diafol

You don't provide any code nor table structure, so it's very difficult to know what you're doing. Are you sure that the db table that you're deleting from is the same one that you're selecting from?

this is the structure

CREATE TABLE IF NOT EXISTS `messages` (
  `msg_id` int(11) NOT NULL AUTO_INCREMENT,
  `message` text CHARACTER SET utf8,
  `description` text CHARACTER SET utf8,
  `uid_fk` int(11) DEFAULT NULL,
  `ip` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
  `created` int(11) DEFAULT '1269249260',
  `uploads` varchar(30) CHARACTER SET latin1 DEFAULT NULL,
  `text` text CHARACTER SET utf8,
  `type` enum('P','A','V','T','E') CHARACTER SET utf8 DEFAULT NULL,
  `believe_count` int(11) DEFAULT '0',
  `review_count` int(11) DEFAULT '0',
  `suggest_count` int(11) DEFAULT '0',
  `network_id` int(11) DEFAULT NULL,
  `views_count` int(11) NOT NULL DEFAULT '0',
  `country_id` int(11) DEFAULT NULL,
  `category_id` int(11) DEFAULT NULL,
  `venue` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `dategig` datetime DEFAULT NULL,
  `fan_count` int(6) NOT NULL DEFAULT '0',
  PRIMARY KEY (`msg_id`),
  KEY `uid_fk` (`uid_fk`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=525 ;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

sorry guys i have found it

Member Avatar for diafol

We need to see the code. Otherwise we,re just guessing

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.