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

时间:2016-10-20 18:47:24

标签: php mysql swift

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?

1 个答案:

答案 0 :(得分:0)

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.