Quick question, probably a simple answer, but it's driving me mad trying to work it out.
I have a MySQL table and a PHP form. The form executes a query, returns each entry of the table using a loop, and creates a number of inputs based on each entry.
e.g. the table contains people. The form aims to allow the user to enter the name and age of each person. The names of the fields are created by using the following syntax: '%sname' and '%sage', to give each field a unique name.
However, I am having trouble referring to these fields when updating the table in another part of the PHP code.
i.e. ...UPDATE person SET age='$%sage'... having executed the same query as mentioned above to loop through all the people.
I assume the problem lies in the syntax of concatenating the names of the fields in the form, and the results of the second query.
Any ideas would be MOST welcome!
😕