I check that user Likes Given that or not, by this link:
for any GET request to the server from user:
#
// my request link in android app, with volley library
www.mydomain.com/check_user_like.php?user_id=userId&post_id=postID
// check_user_like.php
$user_id = $_GET['user'];
$post_id = $_GET['post_id'];
// check if exists row (mysqli)
select id
from likes_tbl
where
likes_tbl.user_id = $user_id
and
likes_tbl.post_id = $post_id
limit 1
if($num_row > 0)
return true;
else
return false;
// result in my android app
if (result == true)
textView.setText("post is liked");
else
textView.setText("post is not liked");
I have 100,000 user and 50,000 post in database. If, for example, I get 1,000 or 10,000 # Requests per second to the server, Is this a problem with the number of requests to the server?
Aucun commentaire:
Enregistrer un commentaire