I would like to show you a diagram of the application flow so click it to enlarge.
As you can see the application will load the information when the page loads, this is why the tutorial is Part 1, on further tutorial the information will not be loaded until the user type the information to search. Now, the code.
Giving answer to one comments that ask about a question mark in one of my tutorials ( http://behstant.com/blog/?p=662 ) I have created this small answer.
I have created a few post about how to Search, Update and Delete data from a MySQL Database with PHP and PDO. Those tutorials are quite simple, but they are very important to follow this tutorial if have never work with this technologies. The tutorials are in Spanish so if you really need them in English I will be glad to translate them.
Something that I would like to remark is that I will give you the scripts to follow this tutorial, so don’t worry :D.
In order to create a nice look and feel to the page I have implemented the framework Boostrap, but if you don’t want to focus on the look and feel you only have to focus on the Form, the event to Fire the Ajax request and the server to process your request.
The next flow chart will show the path that we are going to cover:
Lee el resto del contenido »
May be you have noticed that most of My tutorials are in Spanish, the reason is simple, I am a Spanish speaker. But during all the time that My site and My blog have been up I have seen that not all the people are thankful (I am refering to the spanish speaking people) They just enter copy the code and that’s it, no thank you note. Therefore I have decided to expand My knowledge not just to one group of people but to all the world.
If you can’t understand English very well but still interested in the content I will be happy to contact you and help you in spanish, you just have to ask for support in the Q&A tab above this post
Happy coding !!
Para finalizar la serie de tutoriales donde trabajamos con una tabla llamada ‘empleado’ en esta ocación voy a enseñar como ingresar un registro (ya que los registros que tenemos los ingresamos directamente por un query) y también como eliminar un registro. Para completar este tutorial debes de haber realizado los siguientes tutoriales, o también puedes ir directo al código e interpretarlo:
- Método PDO::prepare Obtener Resultados con Parametros
- Crear Tabla HTML con ID y Mostrar Información (PHP,MySQL)
Como anteriormente ya había mencionado los métodos para actualizar o buscar un registro, en esta ocación vamos a reutilizar el código que hemos estado trabajando y procederemos a crear una inserción y eliminar un registro. Primero que nada vamos a revisar la sintaxis de SQL para poder realizar nuestros queries.
INSERT INTO nombre_tabla(column1,column2,columnN) VALUES(value1,value2,valueN);
DELETE FROM nombre_tabla WHERE identificador = n;