Home » MySQL, PHP5 March 2008

Very simple add, edit, delete, display in PHP

Before I had posted an article to add, edit, delete, and display contents. I had also included sessions there. There was the facility to login and register users too.

But i got feedback that it was a bit complex for novice users of PHP (users who have just started PHPing). It was a kind of full-fledge system with PHP, MySQL and session.

So in this article, I have simplified the same functionality of the above tutorial. I have not used session in this case. If you want tutorial about session, login, and register then you can refer to my previous article (the link which is provided above).

Files included in this tutorial/code:

users.sql = This contains sql queries to make MySQL database and table

config.php = contains the database connection code (this file is included in all the php pages with the include() function)

index.php = contains the display part (displaying data from database)

add.html = contains form to add data

add.php = contains php code to add data

edit.php = contains php code to edit data

delete.php = contains php code to delete data

Download full source code: Create, read, update, delete in php and mysql

Cheers,

From Mukesh Chapagain's Blog, post Very simple add, edit, delete, display in PHP

php magento mukesh chapagain

Get New Post by Email

Find me on

Facebook Twitter Google+ LinkedIn RSS Feed
  • Michael

    Thanks for your help sir….

  • Jsquad2008

    thak you sir for your kind!…

  • Bulbul4u_only

    thanks

  • Avinash Powar

    This is very good but how can i edit if my data type is TEXT & textarea control ?

  • Thalhah Amir

    thanks

  • Trebor

    many thanks for posting this tutorial. Question please, for me Edit page only displays first six or so characters in name, age and email fields. Is there a way to display more or all characters?

  • Trebor

    many thanks for posting this tutorial. Question please, for me Edit page only displays first six or so characters in name, age and email fields. Is there a way to display more or all characters?

  • Priyanshu Mittal

    hey thts a coll example thnk you helped me alot

  • Cindie Kato

    tnx dude

  • Ravi

    Thanks Mukesh,
    Your code is very helpful , I am creating a small client server application with database.
    Users(with different login) can submit their daily data and can see and edit them .
    admin can see all the users and generate report.

    I am still in process , but your code has help me a lot in user page development.
    thanks
    Ravi

  • Srinivas4146

    good tutorial for learners

  • Pingback: Very simple add, edit, delete, display in PHP « PHP MySQL

  • Lucky

    Thx So much ………..u r great…..

  • Beng Ngim

    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in D:wwwcrud-simpleindex.php on line 24

    How to fix it? Plz…

  • User

    How can I add pagination please help.

  • http://blog.chapagain.com.np/ Mukesh

    It should work without warning. Have you already added data into the database table? You may use mysql_fetch_assoc instead of mysql_fetch_array and test as well.

  • Tef Fy

    Thank you for the tutorial. Simple tutorial like this it’s very appreciated. Please keep posting.

  • Manda Mirza

    helo can you help me in this task tef ?