I write this about why the PHP background interface can only return one piece of data to the database. I want to return all the data that matches the uphonenumber.

<?php
    header("Content-Type:application/json;charset=UTF-8");
    $uphonenumber = $_POST["phonenumber"];//post
    $json = "";
    $data = array();
    include("init.php");//
    
    //$sql = "SELECT * FROM yffice_project where uphonenumber = $uphonenumber";
    $sql = "SELECT * FROM yffice_project where uphonenumber = $uphonenumber";
    mysql_query("set names utf8");
    $result = mysql_query($sql);//sql
    if($result){
    //echo "";
    while ($row = mysql_fetch_array($result))
    {
    $data["uid"]=$row["uid"];
    $data["pcontent"]=$row["pcontent"];
    $data["src"]=explode(",",$row["ppic"]);
    $data["pdate"]=$row["pdate"];
    $data["pweek"]=$row["pweek"];
    $data["pweather"]=$row["pweather"];
    }
    $json=json_encode($data);
    echo $json;
    }else{
    echo "";
    }
    mysql_close();//
?>
Php
Feb.28,2021

there is a problem with the assignment in your while loop, and the assignment to the same key name is repeated all the time.
the correct one should be:

$data[] = [
    'uid'      => $row["uid"],
    'pcontent' => $row["pcontent"],
    'src'      => explode(",",$row["ppic"]),
    'pdate'    => $row["pdate"],
    'pweek'    => $row["pweek"],
    'pweather' => $row["pweather"]
];

this form;


there is a problem with loop writing. If you write like this, the current data will overwrite the previous data, and only the last piece of data will be returned

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a858-345ce.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a858-345ce.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?