May I know you?

|
prads98 2021-05-16 19:59:15
Why???
Shubbb 2021-05-16 21:12:09
AryanManik 2021-05-16 15:30:59
Not working

In ci 4 loading model is like
$login_model = new Login_model();
$check = $login_model->validate();

AryanManik 2021-05-16 21:21:48
Shubbb 2021-05-16 21:12:09
In ci 4 loading model is like
$login_model = new Login_model();
$check = $login_model->validate();

I try this

AryanManik 2021-05-16 21:22:25
codeslide-32287.jpg

LiveRichly 2021-05-16 21:24:45
AryanManik 2021-05-16 21:22:25

Bro first confirm which version are you using Ci 3 or 4

AryanManik 2021-05-16 21:24:54
4
LiveRichly 2021-05-16 21:25:30
Ok
LiveRichly 2021-05-16 21:26:18
Do not use _ in your model also keep it as one word
LiveRichly 2021-05-16 21:26:40
Loginmodels like this
LiveRichly 2021-05-16 21:27:05
Also keep the file name same as your model name
LiveRichly 2021-05-16 21:32:30
echo ‘User IP Address – ‘.$_SERVER[‘REMOTE_ADDR’];
LiveRichly 2021-05-16 21:33:33
You always welcome ☺️
Milan Sharma 2021-05-17 08:47:21
please help me
Milan Sharma 2021-05-17 08:49:37
my app is sending me this data

i dont know how can i insert it in to mysql

{“latitude”:”37.36754″,”longitude”:”-122.165005″,”fcmToken”:”cAAqNt70SXmYoFNUWfhh-n:APA91bG0rp9rLELm9qn5I2eRx6u5eQyVBEQ_u32sqICmA-lWzN21xwSGRnOWop6MSU2qJOUzecu1jK9ilFLea5nWa2ssyZnt4WJQR5OLZWEVu7049swkO13ncfcvrDXuNd4i2tIw0koa”,”deviceId”:””,”userId”:””}

Lost_boy6 2021-05-17 08:51:10
Use json_decode to get individual value then you can insert each value in different field
Milan Sharma 2021-05-17 09:02:42
codeslide-32314.jpg

Milan Sharma 2021-05-17 09:06:34
let me check
Milan Sharma 2021-05-17 09:08:34
codeslide-32318.jpg

Milan Sharma 2021-05-17 09:08:53
is that correct
Milan Sharma 2021-05-17 09:09:58
*sorry
Milan Sharma 2021-05-17 09:10:19
m removing args… which was sending me from my app
Milan Sharma 2021-05-17 09:15:17
i meant to say you that…. i have received data i knew it already… but how can i insert into db??
Milan Sharma 2021-05-17 09:15:29
i think yiou didnt understand
Milan Sharma 2021-05-17 09:17:18
i already sent you data which i got from my app sent to my server
Milan Sharma 2021-05-17 09:17:30
i stored in log file…
2021-05-17 09:27:47
Milan Sharma 2021-05-17 09:17:18
i already sent you data which i got from my app sent to my server

I think you don’t know to save data to db

Milan Sharma 2021-05-17 09:28:49
ohhh really??
hahhahahaha
Milan Sharma 2021-05-17 09:29:09
i have worked about 6-7 project already… but i dint worked in api based
Milan Sharma 2021-05-17 09:29:24
now working android with php slim framework api
2021-05-17 09:30:28
Milan Sharma 2021-05-17 09:29:24
now working android with php slim framework api

I can help you in core PHP for that but not with this Framework as I have worked with core PHP with APIs

Milan Sharma 2021-05-17 09:33:32
okey let me know about following code:

$remote_data = $request->getParsedBody();
file_put_contents(“post.log”, $remote_data);

it gives proper data in file as below
{“latitude”:”37.36754″,”longitude”:”-122.165005″,”fcmToken”:”cAAqNt70SXmYoFNUWfhh-n:APA91bG0rp9rLELm9qn5I2eRx6u5eQyVBEQ_u32sqICmA-lWzN21xwSGRnOWop6MSU2qJOUzecu1jK9ilFLea5nWa2ssyZnt4WJQR5OLZWEVu7049swkO13ncfcvrDXuNd4i2tIw0koa”,”deviceId”:””,”userId”:””}

i want store it in db instead in file… with column name and its value

2021-05-17 09:36:32
Milan Sharma 2021-05-17 09:33:32
okey let me know about following code:

$remote_data = $request->getParsedBody();
file_put_contents(“post.log”, $remote_data);

it gives proper data in file as below
{“latitude”:”37.36754″,”longitude”:”-122.165005″,”fcmToken”:”cAAqNt70SXmYoFNUWfhh-n:APA91bG0rp9rLELm9qn5I2eRx6u5eQyVBEQ_u32sqICmA-lWzN21xwSGRnOWop6MSU2qJOUzecu1jK9ilFLea5nWa2ssyZnt4WJQR5OLZWEVu7049swkO13ncfcvrDXuNd4i2tIw0koa”,”deviceId”:””,”userId”:””}

i want store it in db instead in file… with column name and its value

You are Doing right but have you set Content type in your Application while sending data

Milan Sharma 2021-05-17 09:47:29
slim framework auto detect content type dude
2021-05-17 10:53:47
Milan Sharma 2021-05-17 09:47:29
slim framework auto detect content type dude

No check its docs , ihave search for your question Google and found it that you have to send Content type for Json object data

Rekha M.G 2021-05-17 11:10:01
When is use global session . I don’t get data stored. May I know you?
|