Skip to content
Advertisement

Update the data of an existing table in PHP

I need to make a table of searches made by the user in php. My code fails to encapsulate every new result in the table. I’d like you not to create a new table every time and delete the data, but to gradually add to the data already in the table. Also I have a problem with highlighting accents or special characters in php, how can I fix it? All my data is taken from a column (MySQL database = cherubini, table = lemmi) where it has already been normalized and therefore it works. In my code I have already tried both php and js, but in both cases they conflict with the search results. I am learning web development on my own by asking many questions about my problems, I hope they are useful. My PHP code doesn’t work because there isn’t my table in your own. You’ve to just to change database and table and two queries. The new table data must be added after the last element in the table. This is my code – it contains PHP code and MySQL connection – :

JavaScript

Advertisement

Answer

You can use something like follows;

JavaScript

Source : https://www.w3schools.com/php/php_mysql_select.asp

You can modify this to match with your table name, columns etc.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement