第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在 React Native 的 TextInput 中獲取 json 數(shù)據(jù)

在 React Native 的 TextInput 中獲取 json 數(shù)據(jù)

PHP
慕運維8079593 2021-08-28 15:36:14
我只是一個初學者所以幫助我!我想在本機 TextInput 中獲得 JSON 響應。[我在本機應用程序中有 2 頁。在第一頁 ==> 我想要該 JSON 數(shù)據(jù)并導航到帶有該 JSON 響應的第二頁。我使用 PHP 作為服務器端腳本語言。我的PHP代碼是:<?php// Importing DBConfig.php file.include 'DBConfig.php';// Creating connection. $con = mysqli_connect($HostName,$HostUser,$HostPass,$DatabaseName); // Getting the received JSON into $json variable. $json = file_get_contents('php://input'); // decoding the received JSON and store into $obj variable. $obj = json_decode($json,true);// Populate column from JSON $obj array and store into $coulmn.$firstname = $obj['firstname'];$lastname = $obj['lastname'];//$mobileno = $obj['mobileno'];$email = $obj['email'];$profession = $obj['profession'];$mobileno = '7874853188';//Applying User Login query with mobile number match.$Sql_Query = "select firstname,lastname,email,profession from member where mobileno = '$mobileno' ";// Executing SQL Query.$check = mysqli_fetch_array(mysqli_query($con,$Sql_Query));if(isset($check)){ $SuccessLoginMsg = 'Data Matched'; // Converting the message into JSON format.$SuccessLoginJson = json_encode($SuccessLoginMsg); $first_name = $check[0]; $last_name = $check[1]; $email = $check[2]; $profession = $check[3];// Echo the message. echo $SuccessLoginJson ;  } else{ // If the record inserted successfully then show the message.$InvalidMSG = 'Enter valid phone number' ;// Converting the message into JSON format.$InvalidMSGJSon = json_encode($InvalidMSG);// Echo the message. echo $InvalidMSGJSon ; } mysqli_close($con);?>上面的代碼是 100% 正確的。[在網(wǎng)頁上測試]在我的本機代碼中,首先我檢查手機號碼 => 如果手機號碼正確[存在于數(shù)據(jù)庫中],那么該用戶可以使用該 JSON 響應轉到下一頁。
查看完整描述

2 回答

?
LEATH

TA貢獻1936條經(jīng)驗 獲得超7個贊

您收到的某些數(shù)據(jù)似乎不是string value。您只能設置string valuefor Textinput。檢查接收到的數(shù)據(jù)的值并確保數(shù)據(jù)是string.


如果你只是想擺脫錯誤,


navigation.navigate("Profile",

              {EmailId: JSON.stringify($email),

              Name: JSON.stringify($firstname+$lastname),

              Profe : JSON.stringify($profession),

              mobileno : JSON.stringify(UserMNO),

              });


查看完整回答
反對 回復 2021-08-28
  • 2 回答
  • 0 關注
  • 165 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號