Ok my friend thanks . And could you  help me to learn more about pdos .
Because y was reading the pdos document in the web site from php.  But I if
I could give me some links. To read more about this.  Thanks
El 17/04/2013 09:59, "asgallant" <[email protected]> escribió:

> With PDO's, setting the PDO variable ($db in your script) to null closes
> the connection.  Most sources I have read also say to set all prepared
> statement variables ($query in your script) to null as well, but I'm not
> certain that this is strictly necessary.  You are setting both of them to
> null already, so you don't have to do anything else.
>
> On Wednesday, April 17, 2013 4:11:21 AM UTC-4, Chrystopher Medina wrote:
>>
>> my friend how can i  close the database here in this script .
>>
>> <?php
>> if ($_POST['user']!= '' && $_POST['pwd']!= ''){
>> $username = "root";
>> $password = "chrystopher";
>> $databasename = "si_caoi";
>> try {
>>        $db = new PDO("mysql:dbname=$**databasename",$username,$**
>> password);
>>             }
>> catch (PDOException $e) {
>>         die ($e->getMessage());
>>             }
>>         $query = $db-> prepare('SELECT a.rol, b.nombre_usuario FROM roles
>> a, usuarios b WHERE a.id_rol = b.id_rol AND b.password = MD5(:password) AND
>> b.nombre_usuario = :usuario');
>>         $query->execute(array( 'password' => $_POST['pwd'], 'usuario' =>
>> $_POST['user']));
>> $results = $query->fetchAll(PDO::FETCH_**ASSOC);
>>  $query = null;
>> $db = null;
>> if (count($results) == 1) {
>>  //session_start();
>> //$_SESSION["autentificado"]= true;
>>  //$_SESSION["usuario"]= $_POST["usuario"]."|".$**results[0]['rol'];
>>                 echo 0;
>> }
>>  else {
>>             die ('Error message!');
>>                 echo 1;
>> }
>> }else{
>>     echo 2;
>> }
>> ?>
>>
>>
>> 2013/4/5 asgallant <[email protected]>
>>
>> I have never used arduino; you'll have to look elsewhere for help with
>> that.
>>
>>
>> On Friday, April 5, 2013 4:43:18 AM UTC-4, Chrystopher Medina wrote:
>>
>> well i just want to know if i have to use php or javascript
>>
>>
>> 2013/4/5 Chrystopher Medina <[email protected]>
>>
>> my friend u know how to use arduino with some aplication web .
>>
>>
>> 2013/4/4 Chrystopher Medina <[email protected]>
>>
>> i did something like this my friend  and it works perfectly thanks againd
>> my friend
>> $("#colorNav ul li ul li a").on("click",function(){
>>      $("#contenedorprincipal").**loa**d('vistas/' + $(this).attr('id') +
>> '.html');
>>
>>    });
>>
>>
>> 2013/4/4 asgallant <[email protected]>
>>
>> You are close.  You need one small change:
>>
>> $("#content").load($(this).**att**r(**'id') + '.html');
>>
>> I would also check to make sure that your selector 'div a' is selecting
>> the correct elements.
>>
>>
>> On Thursday, April 4, 2013 3:06:08 AM UTC-4, Chrystopher Medina wrote:
>>
>> my friend i have this file
>> for example how can i know what is the value of the each element <a> ,
>> for example i have a file named page1.html and the id from my first element
>> <a> is ="page1" so i want to get that value and then i just want to get
>> somethin like this
>>
>> well I guess it could be something like:
>>
>>
>>
>>
>> ..............................******..................
>> <script>$(function(){
>>
>>
>>
>> $("div a").on("click",function(){
>>
>> $("#content").load($this.attr(******'id') + .html);   //this is a basic
>> way that i think it could be work but im sure that im wrong. i just want to
>> join the id from the element <a> whitch i click , and this ".html"
>>
>>
>> });
>>
>>
>> });
>> </script>
>>
>>
>> <nav id=menu>
>> <a href="#" id="page1">page1</a>
>> <a href="#" id="page2">page2</a>
>> <a href="#" id="page3">page3</a>
>> </nav>
>> <section id="content">
>> </section>
>>
>>
>>
>> 2013/4/3 asgallant <[email protected]>
>>
>> At a glance, everything else looks OK.  You would get a JSON string that
>> looks like this "[0]" or this "[1]" when you run that code, which would
>> be interpreted as an array with one element which is either a 0 or a 1.
>>
>> On Wednesday, April 3, 2013 5:51:11 PM UTC-4, Chrystopher Medina wrote:
>>
>>  thanks my friend u are right .. but everithing else looks ok.
>>
>>
>> 2013/4/3 asgallant <[email protected]>
>>
>> The PHP function is json_encode, not jsonencode.
>>
>>
>> On Wednesday, April 3, 2013 5:31:22 PM UTC-4, Chrystopher Medina wrote:
>>
>> my friend it works perfectly thanks..... my friend i have anoter cuestion
>>
>> well i have a form and i send my data to the server in order to check if
>> the user and passwor are ok.
>> i do this jus to test.
>>
>> thi is my php file
>>
>> if($_post['user']=='xhava' && $_post['password']=='12345'){
>> echo 1;
>> }else {
>> echo 0;
>> }
>>
>> and in my javascript file i jus have this
>>
>> well i have mi function in order to send the data to the server and in
>> order to receive the values i do thi
>>
>> function(data){
>> if(data===1){
>> alert("you have logged");
>> }else{
>> alert("you have not logged in ");
>> }
>> }
>>
>> but how i can send from my php file to the javascript file the data in
>> json format......
>>
>> i had done somethin like this but it did not work.
>>
>> $myarray = array();
>>
>> if($_post['user']=='xhava' && $_post['password']=='12345'){
>> $myarray[0] = 1;
>> }else {
>> $myarray[0]=0;
>> }
>>
>> echo jsonencode($myarray);
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 2013/4/3 asgallant <[email protected]>
>>
>> Like most things, sessionstorage and server sessions have their benefits
>> and drawbacks, and which you use largely depends on what you need to
>> accomplish; neither one is inherently better than the other.  Basically,
>> the difference a
>>
>> ...
>
>  --
> 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
> [email protected].
> To post to this group, send email to
> [email protected].
> 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 [email protected].
To post to this group, send email to [email protected].
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