Page 1 of 1

Empty Rows from Table --- MySQL

Posted: Fri Jun 16, 2006 12:15 pm
by tecktalkcm0391
I am having a brain fart. How do you empty the table of a mysql database.

Empty does just get ride of all of the data in the table and not the table...???

Thanks! :D :)

Posted: Fri Jun 16, 2006 12:20 pm
by Grim...
Either

Code: Select all

DELETE FROM tablename
or

Code: Select all

TRUNCATE TABLE tablename
TRUNCATE will also reset the autonumber counter.

Posted: Fri Jun 16, 2006 12:24 pm
by tecktalkcm0391
will they both delete every row in the table?

Posted: Fri Jun 16, 2006 12:25 pm
by Roja
tecktalkcm0391 wrote:will they both delete every row in the table?
Look them up in the manual. Try them both.

Heck, do ANYTHING but post ANOTHER post asking people to answer yet another question you could find out yourself with 2 minutes effort.

Posted: Fri Jun 16, 2006 12:42 pm
by tecktalkcm0391
Roja wrote:
tecktalkcm0391 wrote:will they both delete every row in the table?
Look them up in the manual. Try them both.

Heck, do ANYTHING but post ANOTHER post asking people to answer yet another question you could find out yourself with 2 minutes effort.
FINE, that was a bit rude, anyone eles agree?

Posted: Fri Jun 16, 2006 1:09 pm
by Grim...
It was unsubtle, but it wasn't entirely innacurate.
Did you try them?

Posted: Fri Jun 16, 2006 1:10 pm
by John Cartwright
tecktalkcm0391 wrote:
Roja wrote:
tecktalkcm0391 wrote:will they both delete every row in the table?
Look them up in the manual. Try them both.

Heck, do ANYTHING but post ANOTHER post asking people to answer yet another question you could find out yourself with 2 minutes effort.
FINE, that was a bit rude, anyone eles agree?
Yes, it could have been said a bit more polite :? Either way, he absolutely has a point -- in that you should be trying things yourself aswell.

Incase you didn't know, the mysql manual can be found here http://dev.mysql.com/doc/

Posted: Fri Jun 16, 2006 1:15 pm
by RobertGonzalez
Maybe not quite as friendly as could be, but it holds some truth. Every regular poster here will tell you pretty much the same thing...

1) Read the manual
2) Search Google
3) Search this community (and others if you can't find the answer here)
4) Post your question
5) Take the advice you get, try it. If it doesn't work, repeat steps 1 through 4, then post back.

As has been said many times before, there are a lot of people here that are willing to help you. Few are willing to do it for you without getting paid for it. I am sure that Roja is just frustrated with the repetitive posts that appear to be for things that could be searched for by the original poster.

Posted: Fri Jun 16, 2006 1:17 pm
by John Cartwright
Since a lot of people are replying to whether it was rude or not.. let me point out that if you have a problem with a member this is not the proper way to handle it. Simply contact a moderator and let us moderate the situation

Carry on ;).

Posted: Fri Jun 16, 2006 1:50 pm
by Roja
tecktalkcm0391 wrote:
Roja wrote:
tecktalkcm0391 wrote:will they both delete every row in the table?
Look them up in the manual. Try them both.

Heck, do ANYTHING but post ANOTHER post asking people to answer yet another question you could find out yourself with 2 minutes effort.
FINE, that was a bit rude, anyone eles agree?
Rude: "Abruptly and unpleasantly forceful".

Abrupt, it was not. Numerous members have coached, encouraged, suggested, stated, and even linked you to search engines for a large number of your posts - many of which could be answered without effort by simply *pasting your exact query unedited into google*.

Unpleasant? Perhaps, but that depends on the point of view. From my point of view, your posts continue to draw time, energy, and enthusiasm away from posts that actually need help. Thats unpleasant, so I'd say that the turn of phrase I used was appropriate based on your continued lack of effort before posting. But I could buy unpleasant.

Forceful, definitely rings true. Every other form of tact, subtlety, respect, encouragement, and phrasing with you seems to have failed. So yes, I fell back to coarse discourse, and made a clear, forceful statement that you need to put effort into your problems before asking others to solve them for you.

This thread was the perfect example of your posting habits, and I did not hesitate to point it out. Almost every moderator, and a number of high-post-count members have posted encouragement in every possible phrasing asking you to "Research, then Search, then Try" before posting, and this thread clearly shows that none of their requests or encouragement resulted in you doing so.

Based on all of that, I don't feel I was out of place for my comments. Its certainly not the norm here on these forums, but neither are your posts. I only posted that way after numerous other threads where I (in addition to others) encouraged you nicely to research, search, and try before posting.

I can accept that my post wasn't in the spirit of the rest of the forums, but I don't regret my post. There is a time to say that enough is enough, and its well past that point. If the mods choose to warn me for it, I can respect their decision.

All people - including myself - have asked you to do, is put effort in before asking others to do so. I simply said so in a forceful manner, after seeing you ignore dozens of similar requests, including my own.

Perhaps you should focus less on the tone, and more on the message which you continue to not absorb.

Posted: Fri Jun 16, 2006 1:57 pm
by JayBird
I have to agree with everything Roja has said here.

Please take time to reasearch yourself, and maybe even follow the methods that Roja posted here to solve problems.

By all means ask questions, but it seems like you have treated this forum as your personal helpline with no thought from yourself. Your posted habits have been noted previously.

Helping yourself initially will help you more in the long run.

All i am saying is think about it before asking a question, show that you have tried yourself and fialed and the research you have done.

Posted: Fri Jun 16, 2006 3:16 pm
by tecktalkcm0391
The thing I don't get is that other people on this forum post questions just as dumb as this one, and they don't get any problems. If you don't want to help then why do you even bother posting something rude, or "Abruptly and unpleasantly forceful".

I DO try to look things up, and I don't try to use this site as my personal hotline. Everyother forum I've ever asked questions on didn't have any member that were rude. This forum has a lot of nice people, but I just think that some people aren't getting payed to do stuff on this site, so when little questions that are so easy come up, they get all mad by it.

The reason I posted this was my database just had a problem at the time of the posting and I couldn't remember the code, and I needed it to be right up, so my downtime wouldn't be long... all I was going to be deleting was some login times, and I wanted to empty out the table with them in it.

I kinda fell like some members of this fourm are breaking rule 1.3, 13, of the fourm, but whatever. I am not going to report you to the mods or anything.


Do you guys want me to start posting every google search I do?
I am sorry if I am sounding rude. Remember
Forum Rules wrote: 1.1 Posting
5. People of all ages visit this forum ...
I am only 15, only a week and 1/2 into PHP, and I have learned a lot both on this forum and by myself. I don't just ask questions, but I also answer quite a few.


And now, I am through with this thread.

Just for the record: I don't have any problem with any member.

Posted: Fri Jun 16, 2006 3:37 pm
by JayBird
Good good, i'm glad we can been sensible about this and not all get mad with each other :D

We will gladly help you, but all we are saying is, google, google a bit more, sreach this forum, read the manual, then maybe put together a question here

The issue isn't about this partulcar thread, it is about the number of threads over the last week or so, to which many i have found the answer by searching this forum or google.

We shall leave the issue there. If you want to discuss it further you can PM me.

Thanks

Mark