or please give me some examples to do some querys in pdo´s or something
like that and i will try to change that script. please


2013/5/14 Chrystopher Medina <xhav...@gmail.com>

> ok my friend really a lot of thanks.
>
> my friend another favor please. i wanna use pdo´s but it is really hard
> for me. i don´t understand very well. please could u teach me how i can
> change this next script:
>
>
> please i have been reading a little about pdo but i did not undestand.
> please my friend . help me to change this ... and really i would apreciate
> it if u could add some comments...
>
> <?php
> try
> {
> //Open database connection
> include('../conexion.php');
>
> //Getting records (listAction)
>  if($_GET["action"] == "list")
> {
> //Get records from database
>  $result = mysql_query("SELECT * FROM recintos;");
>  //Add all records to an array
>  $rows = array();
> while($row = mysql_fetch_array($result))
> {
>     $rows[] = $row;
> }
>
> //Return result to jTable
>  $jTableResult = array();
> $jTableResult['Result'] = "OK";
> $jTableResult['Records'] = $rows;
>  print json_encode($jTableResult);
> }
> //Creating a new record (createAction)
>  else if($_GET["action"] == "create")
> {
> //Insert record into database
>  $result = mysql_query("insert into recintos
> values('0','".$_POST['nombre_recinto']."','".$_POST['descripcion_recinto']."');");
>  //Get last inserted record (to return to jTable)
> $result = mysql_query("SELECT * FROM recintos WHERE id_recinto =
> LAST_INSERT_ID();");
>  $row = mysql_fetch_array($result);
>
> //Return result to jTable
> $jTableResult = array();
>  $jTableResult['Result'] = "OK";
> $jTableResult['Record'] = $row;
> print json_encode($jTableResult);
>  }
> //Updating a record (updateAction)
> else if($_GET["action"] == "update")
>  {
> //Update record in database
> $result = mysql_query("UPDATE recintos SET nombre_recinto = '" .
> $_POST["nombre_recinto"] . "', descripcion_recinto = '" .
> $_POST["descripcion_recinto"] . "' WHERE id_recinto = " .
> $_POST["id_recinto"].";");
>
> //Return result to jTable
> $jTableResult = array();
> $jTableResult['Result'] = "OK";
>  print json_encode($jTableResult);
> }
> //Deleting a record (deleteAction)
>  else if($_GET["action"] == "delete")
> {
> //Delete from database
>  $result = mysql_query("DELETE FROM recintos WHERE id_recinto = " .
> $_POST["id_recinto"] . ";");
>
> //Return result to jTable
>  $jTableResult = array();
> $jTableResult['Result'] = "OK";
> print json_encode($jTableResult);
>  }
>
> //Close database connection
> mysql_close($con);
>
> }
> catch(Exception $ex)
> {
>     //Return error message
> $jTableResult = array();
> $jTableResult['Result'] = "ERROR";
>  $jTableResult['Message'] = $ex->getMessage();
> print json_encode($jTableResult);
> }
>  ?>
>
>
> 2013/5/14 asgallant <drew_gall...@abtassoc.com>
>
>> There are two different things that you could be looking for here, so
>> let's clarify a bit: having a spinner run while the page itself is loading
>> might be problematic (you can't do much of anything until the page is
>> loaded - your best bet would be to include an <img> tag at the top of your
>> HTML and hide it when the page is loaded).  If you want to use a spinner
>> while your AJAX calls are being fetched, that's a different story
>> altogether, and the jQuery plugins will handle that for you; you just need
>> to find a plugin that you like.
>>
>> On Tuesday, May 14, 2013 3:11:16 PM UTC-4, Chrystopher Medina wrote:
>>
>>> well i have mi spinner , i just wanna show it before the page be loaded.
>>> or even i have to use jquery spinner
>>>
>>>
>>>
>>> 2013/5/14 asgallant <drew_g...@abtassoc.com>
>>>
>>>> Do you want a "loading" spinner (or something like it)?  There are
>>>> jQuery plugins that can do that for you (search for jQuery spinner).
>>>>
>>>>
>>>> On Tuesday, May 14, 2013 1:52:56 PM UTC-4, Chrystopher Medina wrote:
>>>>
>>>>> hi my frined u know i have this
>>>>>
>>>>> $(document).on('ready',**functio**n(){
>>>>>     //$("nav div ul li ul li a").on('click',function(e){
>>>>>       // $("#contenido").load('vistas/' + $(this).attr('id') + '.php');
>>>>>       //});
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>        $("#contenido").load('vistas/****ayuda.php');
>>>>> $(".menu").on('click',**function**(){
>>>>>    $("#contenido").load('vistas/****' + $(this).attr('id') + '.php');
>>>>>
>>>>> });
>>>>>
>>>>>
>>>>> });
>>>>>
>>>>> but i just wanna show a image.gif  before load and when the page be
>>>>> load the image hides like next
>>>>>
>>>>>  $("#cargando").show();
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> 2013/5/13 Chrystopher Medina <xha...@gmail.com>
>>>>>
>>>>> Thanks my friend I will keep investigating about that.
>>>>>>
>>>>>
>>>>>  --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "Google Visualization API" group.
>>>> To unsubscribe from this topic, visit https://groups.google.com/d/**
>>>> topic/google-visualization-**api/-zapZe7dH7Y/unsubscribe?**hl=en<https://groups.google.com/d/topic/google-visualization-api/-zapZe7dH7Y/unsubscribe?hl=en>
>>>> .
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> google-visualization-api+**unsubscr...@googlegroups.com.
>>>> To post to this group, send email to google-visua...@**googlegroups.com
>>>> .
>>>>
>>>> Visit this group at http://groups.google.com/**
>>>> group/google-visualization-**api?hl=en<http://groups.google.com/group/google-visualization-api?hl=en>
>>>> .
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>>
>>>>
>>>
>>>  --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Google Visualization API" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/google-visualization-api/-zapZe7dH7Y/unsubscribe?hl=en
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> google-visualization-api+unsubscr...@googlegroups.com.
>> To post to this group, send email to
>> google-visualization-api@googlegroups.com.
>> Visit this group at
>> http://groups.google.com/group/google-visualization-api?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to