Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Want to develop a Book review iOS application using php,mysql and Xcode, please help

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 458
    Answer it

    1

    In this tutorial, I am using the same hosting service (bluehost) in combination with wordpress. Does anyone know why the page is showing an error message when I input the url... aside from this issue. I am following along in this tutorial and I'd like to be able to change the database, to reflect a list of tabs to navigate to books reviews, based on a wordpress website that I have. Any help with this will be highly appreciated, thank you! I have a project due tomorrow and I am really needing help on this.

     

    <?php
     
    // Create connection
    $con=mysqli_connect("localhost","username","password","dbname");
     
    // Check connection
    if (mysqli_connect_errno())
    {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
     
    // This SQL statement selects ALL from the table 'Locations'
    $sql = "SELECT * FROM Locations";
     
    // Check if there are results
    if ($result = mysqli_query($con, $sql))
    {
        // If so, then create a results array and a temporary one
        // to hold the data
        $resultArray = array();
        $tempArray = array();
     
        // Loop through each row in the result set
        while($row = $result->fetch_object())
        {
            // Add each row into our results array
            $tempArray = $row;
            array_push($resultArray, $tempArray);
        }
     
        // Finally, encode the array to JSON and output the results
        echo json_encode($resultArray);
    }
     
    // Close connections
    mysqli_close($con);
    ?>
    • I've added the phpmyadmin database image below

    Database in PHPADMIN

 0 Answer(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: