These are chat archives for angular/angular-2-ionic-2

20th
Apr 2018
Anbarasan
@Anbarasan-321
Apr 20 2018 10:41
Hi
need a help for login and signup method for ionic with link to mysql database
Please anyone help me to get output for that!!!
Owen Melbourne
@OwenMelbz
Apr 20 2018 10:58
is it a remotely hosted database? or a locally installed sqlite ?
Anbarasan
@Anbarasan-321
Apr 20 2018 10:59
locally installed sql
which is controlled by xampp
Owen Melbourne
@OwenMelbz
Apr 20 2018 11:00
right - so that would count as a remote database - as its not installed on the phone in production
so you'd need to create an API in something like php/ruby/node what ever which your app sends the data to, it then inserts it and responds back
Anbarasan
@Anbarasan-321
Apr 20 2018 11:01
ya write tried to write API with php
Luke Skelhorn
@SCRATK
Apr 20 2018 11:01
I've used laravel as an API for my last ionic app
works great
Anbarasan
@Anbarasan-321
Apr 20 2018 11:02
I've used laravel as an API for my last ionic app... ya great can you explain it please
Luke Skelhorn
@SCRATK
Apr 20 2018 11:03
Well Laravel is a MVC framework for php which has authentication built in so to get signin/up methord working you will need an API built in something like php/ruby or node just like @OwenMelbz said
Anbarasan
@Anbarasan-321
Apr 20 2018 11:04
ya i tried below file

<?php
//open connection to mysql db
$connection = mysqli_connect("localhost","root","","app") or die("Error " . mysqli_error($connection));

//fetch table rows from mysql db
$sql = "select * from users";
$result = mysqli_query($connection, $sql) or die("Error in Selecting " . mysqli_error($connection));

//create an array
$emparray = array();
while($row =mysqli_fetch_assoc($result))
{
    $emparray[] = $row;
}
echo json_encode($emparray);

//close the db connection
mysqli_close($connection);

?>

this is my api
i got encrypt password for this
i got only users data with this
Luke Skelhorn
@SCRATK
Apr 20 2018 11:06
I would suggest taking a look at this https://laravel.com/
Anbarasan
@Anbarasan-321
Apr 20 2018 11:06
So please explain how i write API for that
Owen Melbourne
@OwenMelbz
Apr 20 2018 11:07
laravel has built in api functionality
but that is a full blown framework
Luke Skelhorn
@SCRATK
Apr 20 2018 11:07
You can use something like lumen
Owen Melbourne
@OwenMelbz
Apr 20 2018 11:08
if you just need user registration, then maybe look at ionics own authentication system, or something like firebase etc.
Luke Skelhorn
@SCRATK
Apr 20 2018 11:08
but from what i have read its not that much faster
Was gunna say something like firebase would be better
Anbarasan
@Anbarasan-321
Apr 20 2018 11:10
I've used laravel as an API for my last ionic app..... Can you share API details? please
Luke Skelhorn
@SCRATK
Apr 20 2018 11:10
Their is no API Details to share you have to build it
Anbarasan
@Anbarasan-321
Apr 20 2018 11:11
okay can you explain its concept please
I have encrypt password in my database
Owen Melbourne
@OwenMelbz
Apr 20 2018 11:12
google is your friend
Anbarasan
@Anbarasan-321
Apr 20 2018 11:12
how i decrypt that one
Owen Melbourne
@OwenMelbz
Apr 20 2018 11:12
NEVER encrypt passwords EVER EVER EVER
only ever generate hashes of them
Luke Skelhorn
@SCRATK
Apr 20 2018 11:12
Thanks @OwenMelbz
Owen Melbourne
@OwenMelbz
Apr 20 2018 11:13
passwords should always be stored in a 1 way hash, otherwise if a hacker got your encrypted password, they can decrypt it. If they got a hash then its completely different
Anbarasan
@Anbarasan-321
Apr 20 2018 11:13
Ohhh thanks I am new to this
https://laracasts.com/ a great video website with free content showing how to use laravel
Anbarasan
@Anbarasan-321
Apr 20 2018 11:14
Okay How i link with that API with ionic app
Luke Skelhorn
@SCRATK
Apr 20 2018 11:14
Owen Melbourne
@OwenMelbz
Apr 20 2018 11:15
make HTTP requests with something like https://angular.io/guide/http
Luke Skelhorn
@SCRATK
Apr 20 2018 11:15
To link it to your ionic app you will need to make HTTP requests using services
Anbarasan
@Anbarasan-321
Apr 20 2018 11:15
okay
i already know to link my data with ionic app.. can I used that method for this ..
tasoskak
@SirukakSosta
Apr 20 2018 12:05
Hi guys. Im making an ionic app with no native services at the moment. I would like to add registration/login (facebook and google) options. If i select to install the native plugins of fb and google i need to build and serve the app to an emulator every time i want a preview and thats not time efficient. Is there any other way to do that in more efficent way. thanx!!! <3
Owen Melbourne
@OwenMelbz
Apr 20 2018 12:06
not that i know of :D i think thats the point of Capacitor - a platform agnostic api to use 1 bit of code on them all
UncertaintyP
@UncertaintyP
Apr 20 2018 12:32
@SirukakSosta You could use mocks see https://github.com/chrisgriffith/ionic-native-mocks
tasoskak
@SirukakSosta
Apr 20 2018 13:09
@UncertaintyP wow wow thnx a lot im checking it