Jump to content

A little request about PHP form

- - - - -

  • Please log in to reply
2 replies to this topic

#1
xle_camry

xle_camry

    Programmer

  • Members
  • PipPipPipPip
  • 141 posts
Good day dear programmers!

I have to create simple html form, and insert that values into database. (MySQL)

I have done it.

And in my other.php ---> I select all datas from table and fetch it (viewing it in the screen)

Also, no problem.

Now, I have to put EDIT and DELETE buttons near all my data,
and while pressing EDIT, I should be able to update that data directly to database.

How can I do it?

If you have ready form templates done in php, it will be useful for me.

Thanks,
Kind Regards!

#2
logicPwn

logicPwn

    Learning Programmer

  • Members
  • PipPipPip
  • 91 posts
I'm not exactly sure I understand what you need help. Maybe if you posted your code it would help.

#3
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
If rows are displayed on other.php, you can freely place buttons or links beside each row to edit the content.

i.e.

echo $row['data'] . " <a href='other.php?edit=" . $row['id'] . "'>[edit]</a>"; //assuming $row['id'] is the id of the specific data

This would appear as

some data [edit]

It can be handled on the same page, or another page fetching $_GET['edit'] as the ID to modify and update.

If you wish for in place editing, javascript and/or AJAX (asynchronous javascript to make requests) will be necessary. There are some softwares to edit tables, however you may not find a template that just fits in.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users