Page 1 of 1

[SOLVED] CANNOT DELETE...help!!!!

Posted: Sat Jan 31, 2004 5:05 am
by apek
why can't i delete my data in mysql???
this is my query:

Code: Select all

<?php
$viewall=mysql_query("DELETE komponen,jumlah FROM tempkomponen");

?>
and then i try to delete via phpmyadmin,and then this error showed up:

Code: Select all

Error

SQL-query : 

DELETE komponen,
jumlah FROM tempkomponen

MySQL said:

Not unique table/alias: 'komponen'
this is my table structure:

Code: Select all

CREATE TABLE tempkomponen (
  id int(11) NOT NULL auto_increment,
  komponen varchar(50) default NULL,
  jumlah int(11) default NULL,
  PRIMARY KEY  (id)
) TYPE=MyISAM;

pls help...

.........

Posted: Sat Jan 31, 2004 7:05 am
by apek
anyone??? :roll:

Posted: Sat Jan 31, 2004 7:25 am
by timvw
What are you really trying to do?

DELETE rows from a column?
ALTER a column in a table?
DROP a column from a table?

Posted: Sat Jan 31, 2004 7:28 am
by apek
hi...
i just want to delete all the datas in the table...
not dropping them...

Posted: Sat Jan 31, 2004 7:31 am
by timvw
DELETE *
FROM table

Posted: Sat Jan 31, 2004 10:33 am
by twigletmac

Code: Select all

DELETE *
FROM table
won't work because of the asterisk - instead try:

Code: Select all

DELETE FROM tempkomponen
http://www.mysql.com/doc/en/DELETE.html

Mac

............

Posted: Sat Jan 31, 2004 11:25 am
by apek
geee..it works..
thanx a bunch!!!