PHP Tutorials: jQuery: Get data from MySQL Database without refreshing




Want more? Explore the library at https://www.codecourse.com/lessons Official site https://www.codecourse.com Twitter https://twitter.com/teamcodecourse.

source


42 responses to “PHP Tutorials: jQuery: Get data from MySQL Database without refreshing”

  1. I did this tutorial however, I had to change from MSQL to MSQLI as it kept showing errors. Heres what I did on the data.php to get it to work.

     <?php
    $db = new mysqli('localhost','',','');
    if($db->connect_errno) {//echo $db->connect_error;
    die('<br>Oops! we are having some problems.');

    }
    $name = mysqli_real_escape_string($db,$_POST['name']);
     if($name==NULL)
         echo "Please enter a name!";
    else
      
    {

    $age  = mysqli_query($db,"SELECT age FROM rates.People WHERE name='$name'");
    $age_num_rows = mysqli_num_rows($age);
            
           if($age_num_rows==0)
            echo "Name does not exists!";

           else       
    {     
    $rowage = mysqli_fetch_row($age);
    echo "$name's age is $rowage[0]";     
    }
        }?>

  2. This tutorial was good but the code is quiet old if you want to uses mysql_result nowadays you have to use mysqli_result instead and that requires you to create a function for it as php does not recognise is anymore 
    Here is the code to for the function mysqli_result 
    function mysqli_result($res, $row, $field=0) { 
        $res->data_seek($row); 
        $datarow = $res->fetch_array(); 
        return $datarow[$field]; 
    }

  3. How can i update the tables automatic without refreshing the page, what i want to is: Is someone insert a new record in the database in my office from another web browser i want to the new info in my browser but without refresh the page. How can i apply this tutorial to my project?

  4. i have question
    how to show the image from database ?
    i'll try to show it but i have problem with tag that show in result

    when i type the data i want search then it showed <img src=''> like this not show the image

  5. I have a question … how can i display the results in multiple divs   Like i want some of the results to show in one div1 and other results in other div2.   Thanks in advance

  6. Life sucks. My friend has begun seeing a ten because 8 weeks ago he registered to an internet site named Master Attraction (Google it if you desire to learn more.) I'm so envious because I want to fall madly in love as well. How come it's so difficult? I'm gonna look into this Jake Ayres man's information to check out if it may help somebody like me. Crazy thing is, he once had NO success with girls. How can you change so quickly? His girl's a fucking model.

  7. I just love it when people don't explain why something is shitty. It's just shitty folks…Don't know why..It works…this guy just says its shitty so it must be true cause he's got 27 likes…but it works.

Leave a Reply