This page is a permanent link to the reply below and its nested replies. See all post replies »
MartinTheFirst · 26-30, M
;DELETE FROM means youre starting a new line

SW-User
@MartinTheFirst The material I'm following doesn't have that ;
MartinTheFirst · 26-30, M
@SW-User you dont need to write ";" unless you have multiple rows of queries I think
MartinTheFirst · 26-30, M
@SW-User You can divide one single command into multiple rows for ease of reading, but that makes it so that the code compiler needs the end of line character ";" to correctly parse your code.

SW-User
@MartinTheFirst Tried that. Pls check the sc in a comment where I mentioned u.
MartinTheFirst · 26-30, M
@SW-User you need to select something first. You can do SELECT * FROM which means select all that match
[image/video deleted]
MartinTheFirst · 26-30, M
@SW-User aah you're doing a delete, nvm.
look
look
[image/video deleted]
[image/video deleted]
MartinTheFirst · 26-30, M
@SW-User
[image/video deleted]

SW-User
@MartinTheFirst Trying to delete a row. The Select and delete shows greensign with 0 rows being affected

SW-User
@MartinTheFirst This is the full set of codes that are trying:
CREATE DATABASE mydb;
USE mydb;
CREATE TABLE mytable
(
id int unsigned NOT NULL auto_increment,
username varchar(100) NOT NULL,
email varchar(100) NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO mytable (username, email )
VALUES ( "myuser", "myuser@example.com" );
UPDATE mytable SET username="myuser" WHERE id=8
DELETE FROM mytable WHERE id=8
CREATE DATABASE mydb;
USE mydb;
CREATE TABLE mytable
(
id int unsigned NOT NULL auto_increment,
username varchar(100) NOT NULL,
email varchar(100) NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO mytable (username, email )
VALUES ( "myuser", "myuser@example.com" );
UPDATE mytable SET username="myuser" WHERE id=8
DELETE FROM mytable WHERE id=8
MartinTheFirst · 26-30, M
@SW-User dude again you need to write ";" at the end of each command