php tutorial number # 2 ecom store for flutter
php tutorial number # 2 ecom store for flutter
[sourcecode language=”php”] <?php
$conn =new mysqli("localhost","root","","ecom_sales");
// check if user mobile exists or not
$st_check=$conn->prepare("SELECT * FROM users where mobile=?");
$st_check->execute();
$rs=$st_check->get_result();
if($rs->num_rows==0){
$st=$conn->prepare("INSERT INTO users values(?,?,?,?)");
$st->bind_param("ssss",$_GET[‘mobile’],
$_GET[‘password’],$_GET[‘name’],$_GET[‘address’],);
$st-> execute();
echo "1";
}else{
echo "0";
}
?> [/sourcecode]
Want to check api ?
http://localhost/ecom/add_user.php?mobile=0345&password=12345&name=majid&address=lambahourse