How to use Ajax to find a Record with jQuery UI Autocomplete, PHP, MySQL and Json – Part 1

035I have been creating posts with scripts to do small stuff. On this post I would like to show/teach you how to implement the jQuery UI Autocomplete Widget. I have to remark that for the style of the application I am using Bootstrap, so the most important thing is the html code of the form and the Javascript code.

I would like to show you a diagram of the application flow so click it to enlarge.

034

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.


Lee el resto del contenido »

Why the question mark on a SQL query? (VIDEO)

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.

 

Using Ajax to search a Record with PHP, MySQL and jQuery (Look and Feel by Bootstrap)

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 »

New Tutorials and Post in English

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 :D

 

Happy coding !!

Eliminar un registro con PHP (PDO,MySQL)

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:

  1. Crear una conexión a MySQL con PDO

  2. Método PDO::query para obtener resultados con MySQL

  3.  Método PDO::prepare Obtener Resultados con Parametros
  4. 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

INSERT INTO nombre_tabla(column1,column2,columnN) VALUES(value1,value2,valueN);

DELETE

DELETE FROM nombre_tabla WHERE identificador = n;


Lee el resto del contenido »