sql >> Database >  >> RDS >> Mysql

Verbind Android-app-gegevens met Website-database

Test deze php-code omdat je resultaat leeg is:

if (isset ($_GET ["name"])){
    $name = mysql_real_escape_string($_GET ["name"]);
    $query = htmlentities ($query);
    mysql_query("SET NAMES 'utf8'");
    $query = mysql_query("SELECT * FROM my_table WHERE name = '$name');
    $result = mysql_query($query);


    $rows = array();

            if (!empty($result)){
                while($r = mysql_fetch_assoc($result)){
                        // $rows[] = $r; has the same effect, without the superfluous data attribute
                        $r["Column1"] = $r["Column1"];
                        $r["Column2"] = $r["Column2"]; //You can add many columns like the table have
                        $rows[] = $r;                       
                        //$rows[] = array('Deal' => $r);
                    }

                    echo json_encode($rows);

                }

}



  1. postgresql - sql - aantal `echte` waarden

  2. mysql triggers simulatie van beweringen

  3. NLS_CHARSET_DECL_LEN() Functie in Oracle

  4. Django-migratiefout:kolom bestaat niet