简体   繁体   中英

Swift,php,mysql : how to get user information from database

I am creating an simple app which takes user information and shows to the user who is sign in. it like sign in and sign up. I am successfull in inserting the sign up data to database but i don't know how to retrieve current user data when he wants to sign in using json format?

When querying you want to perform a SELECT on the table and then you can add in WHERE conditions and such. Then a mysqli_result object object will be returned. From there you can get the row with fetch_row this will return and associated array.

Now you're at the point where you need to convert the associated array to JSON, which can easily be done with json_encode .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM