Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
-
apek
- Forum Commoner
- Posts: 96
- Joined: Tue Jan 06, 2004 11:19 pm
- Location: Holiday Plaza Johor Bahru
Post
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...
-
apek
- Forum Commoner
- Posts: 96
- Joined: Tue Jan 06, 2004 11:19 pm
- Location: Holiday Plaza Johor Bahru
Post
by apek »
anyone???

-
timvw
- DevNet Master
- Posts: 4897
- Joined: Mon Jan 19, 2004 11:11 pm
- Location: Leuven, Belgium
Post
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?
-
apek
- Forum Commoner
- Posts: 96
- Joined: Tue Jan 06, 2004 11:19 pm
- Location: Holiday Plaza Johor Bahru
Post
by apek »
hi...
i just want to delete all the datas in the table...
not dropping them...
-
timvw
- DevNet Master
- Posts: 4897
- Joined: Mon Jan 19, 2004 11:11 pm
- Location: Leuven, Belgium
Post
by timvw »
DELETE *
FROM table
-
apek
- Forum Commoner
- Posts: 96
- Joined: Tue Jan 06, 2004 11:19 pm
- Location: Holiday Plaza Johor Bahru
Post
by apek »
geee..it works..
thanx a bunch!!!