Is database table insert working fine for you guys? My api which was tested and working fine before suddenly fails to insert new records to the table. I haven’t changed anything in my apis. They were working fine before.
mysql_query(“INSERT INTO db_name_users SET username = '”.$username."’, password = ‘".$password."’");
$id = mysql_insert_id();
Yes I can access it. The read operations are working fine like Login. Or another api which only read and return the data. I think there is some thing wrong with write operations like INSERT.
Thanks for the reply. I wonder why this querymysql_query(“INSERT INTO db_name_users SET username = '”.$username."’, password = ‘".$password."’"); was working for more than 4 years if this is wrong.
Okay I can try the updated query. Btw what is ss in this statement
As above, use prepared statements as suggested by ckhawand. Also this function is deprecated and works in php version <= 5.6. This may be also one of the reason for your query to not work properly.
Thanks guys for the amazing support. Turns out the issue was with the sql query. In db I have two other columns (int). Previously they were automatically inserting 0 value by default. But now the sql was returning error complaining about missing column value. So I did that and also updated the apis form mysql to mysqli.