Answer the question
In order to leave comments, you need to log in
How to update the database and display in the field?
Given: DB called bd, table called table with id and title cells.
How to make it so that in the form field, instead of value, the contents of the title cell are displayed. But only for id=1.
And when you click on the save button, the data was written to the database and when updated, the field had a new value that was previously recorded.
<?тут коннект?>
<form>
<input type="text" value="<? rowsql[title->id=1] ?>">
<input type="" value="Save">
</form>
Answer the question
In order to leave comments, you need to log in
Describe in more detail what kind of form it is and what it should save? What data is in rowsql, array or object?
Decide what you want to save, ID or TITLE? Or both meanings?
Here is an example of a primitive form that outputs the TITLE of a specific unique ID:
<form action="/save.php" method="POST">
<input type="hidden" name="id" value="<? $object['id'] ?>" />
<input type="text" name="title" value="<? $object['title'] ?>" />
<input type="submit" value="Save">
</form>
user_id (int, key) | link_id (int, key)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question