Can insert into DB with php/sql. All "inserts" stop working


Insert command just stop working in whole website. It was working perfectly and just stop 2 days ago. Other command like SELECT, UPDATE and DELETE still works. I dont know what to do…


$sql4 = "insert into ponto (nome, cpf, empresa, diasemana, mes, data, hora, tipo, ip) values(‘$nome’, ‘$cpf’, ‘$empresa’, ‘$dia’, ‘$mes’, ‘$data3’, ‘$hora’, ‘$tipo’, ‘$localip’) ";

$query4 = mysql_query($sql4) or die(mysql_error);

1 Like

What error massage(s) did you get?


I also same to my site, every Insert query doesn’t work, I am using pdo statements too, I thought it was my code but I guess It wasn’t…

1 Like

Can you also share your code?


And error messages, please?

There are many others reporting similar issues so something must be going on. But I need specific information. Do you get any error messages? What do they say? Are you able to enter data manually through phpMyAdmin?


Notice: Use of undefined constant mysql_error - assumed ‘mysql_error’ in /home/vol12_3/ on line 285

yes, manualy is working well. I tried to update the insert code in a few forms and using just one item into insert table but it still not working…


Notice: Use of undefined constant mysql_error - assumed ‘mysql_error’ in /home/vol12_3/ on line 285

Interesting, it seems as if the mysql library is incomplete.

Perhaps this could be fixed, but the thing is that the mysql_* functions are horribly out of date. They were removed with PHP 7 and later, and we will remove all PHP 5 soon as well, meaning it will stop working.

Could you please try changing your code to use the mysqli_* functions instead and see if you can insert data that way? I’m not sure it will fix this issue, but doing this now will prevent further downtime down the line because your code will break on newer versions of PHP.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.