Why doesn’t an INSERT INTO query add records?

Why doesn’t it add records to the table?
Thanks everyone, it works, deleted the table and re-created


Answer 1, authority 100%

1.

$db = mysql_select_db(db, $link);

The unsigned dbparameter $in parentheses is a constant, is it declared somewhere above, or is it perhaps the name of a database? In the second case, you need to enclose the name in quotes.

2.

after line

$result = mysql_query("INSERT INTO 'locomotivs' ('№_locomotive','model','data_vipuska') VALUES ('6','','1990-10-10')");

add

echo mysql_error();

thus, you will see the error that MySQL sends you and, I think, you will understand what’s wrong.

P.S.

The use of special characters in the names of databases, tables, columns, fields is not good and can lead to hard-to-detect errors


Answer 2

extra semicolon in query string


Answer 3

Try this:

$result = mysql_query("INSERT INTO `locomotivs`
          (`№_locomotive`,`model`,`data_vipuska`) VALUES ('6','','1990-10-10');");

Another error here:

$db = mysql_select_db(db,$link);

And it is necessary:

$db = mysql_select_db( 'name_of_my_database', $link );