0

I am having this strange problem. I have this table in a mySQL database called levels with the following columns:

SL_ID (INT)(Auto-Increment),
Level1(INT),
Level2(INT),
Level3(INT).

It works fine when I use the INSERT command to enter data in all three columns (Level1, Level2, Level3).

The problem comes up when I use the INSERT command for entering data into two columns only.

INSERT into levels (Level1, Level2) values ('$value1','$value2')";

It doesn't work at all.

Ideally, it should populate the data on the Level1 and Level2 columns with the variable values, while populating Level3 as '0'. But it fails entirely.

There is no problem with the connection as the page successfully displays data from the same table.

Strangely when I tested it offline, it worked without a problem.

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345

0 Answers0