How to make correction

Hi folks,

I ran following commands
mysql> USE AAADatabase

mysql> INSERT INTO domains VALUES (‘www.aab.org’,‘/var/www/www.aaa.net/web/’);

It should be;


INSERT INTO domains VALUES ('www.aaa.net','/var/www/www.aaa.net/web/');

Please advise how to correct it? TIA

B.R.
satimis

UPDATE domains
   SET the_unknown_column = 'www.aaa.net'
 WHERE the_unknown_column = 'www.aab.org'

:smiley: :smiley:

Hi,

Thanks for your advice.

Hi,

Thanks for your advice and link.

mysql> UPDATE domains
-> SET the_unknown_column = ‘www.aaa.net
-> WHERE the_unknown_column = ‘www.aab.org’;
ERROR 1054 (42S22): Unknown column ‘the_unknown_column’ in ‘where clause’

There is an error

B.R.
satimis

you bet!!! :smiley: :smiley:

did you tell us the column names in your domains table?

no!

so i guessed

apparently i guessed wrong, eh

:slight_smile:

Hi folks,

Sorry I haven’t run mysql sometimes. It took me a while to figure out the command syntax from my recollection.

Mysql version
5.1.49-1ubuntu8.1

$ mysql -u root -p

mysql> SHOW databases;


+--------------------+
| Database           |
+--------------------+
| information_schema |
| lighttpd           |
| mysql              |
+--------------------+
3 rows in set (0.00 sec)

mysql> USE lighttpd;

mysql> SHOW tables;


+--------------------+
| Tables_in_lighttpd |
+--------------------+
| domains            |
+--------------------+
1 row in set (0.00 sec)

mysql> SHOW COLUMNS FROM domains;


+---------+--------------+------+-----+---------+-------+
| Field   | Type         | Null | Key | Default | Extra |
+---------+--------------+------+-----+---------+-------+
| domain  | varchar(64)  | NO   | PRI | NULL    |       |
| docroot | varchar(128) | NO   |     | NULL    |       |
+---------+--------------+------+-----+---------+-------+
2 rows in set (0.00 sec)

mysql> UPDATE domains


    -> SET domain = 'www.aaa.net'
    -> WHERE domain = 'www.aab.org';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

Thanks

satimis