LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-23-2003, 10:44 PM   #1
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Rep: Reputation: 15
Question How to empty database table??


Hi

I have tried using the command under PHP to empty the database table, but it does not. Using phpMyAdmin, I am able to use the empty function to remove the data.

I have issued the command: "delete * from database.table" but it does nothing.

Please advice how can I empty the table without using the phpMyAdmin to empty the table.

Thanks!

Regards
Edward Han
 
Old 10-24-2003, 09:25 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Use truncate: TRUNCATE TABLE table_name

Truncate is also faster then delete.

This, and other cool things, can be found in the mysql documentation.
 
Old 10-24-2003, 08:53 PM   #3
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Hi druuna

Yes, it works! Thanks.

Regards
Edward Han
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
create table in postgres database kranti Linux - Newbie 1 11-15-2005 06:52 PM
Gentoo VNC, empty dialog box !! "Question" window is empty ! TheHushedCaskeT Linux - Software 0 02-01-2005 10:14 PM
empty routing table on bootup tiagolpadua Linux - Networking 0 02-26-2004 07:18 PM
strange partition table - boot partition empty etanter Linux - General 0 12-23-2003 09:46 AM
After insert data, Database is empty ivankong Linux - Software 2 06-16-2003 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration