Answer the question
In order to leave comments, you need to log in
How to set the sync direction in Nextcloud?
The essence of the problem is that there is a collection of photos on the phone that is tangible in terms of number and size (photo reports on the progress of the construction of objects)
. I set up a native client in the client on the phone (android) and indicated which folders to upload to the server.
But this software (I don’t know who exactly is to blame), instead of throwing off the photo sorted into folders on the server, it pulls everything on the phone too. The benefit of memory is 128 gigs - but 40 is already taken by pictures.
Moreover, as the objects are handed over, I throw off the folders with the name of the object on my laptop and delete it on the phone - but the nextcloud again pulls them from the server to the phone.
How to set the sync direction? I know this is a noob question, but still...
Answer the question
In order to leave comments, you need to log in
You cannot execute two queries in a row with MYSQLI_USE_RESULT. You must first close the first request with $result->free(). In your case, if the data on request is not used further, then it is better to use not num_rows, but COUNT (*).
The problem is shoving different buzzwords into the code without understanding their meaning.
If you remove the word MYSQLI_USE_RESULT from the code, then the error will magically disappear.
However, I must admit that there is a homespun truth in the other two answers. If you follow my own advice and use prepare / execute instead of query (since this couple uses USE_RESULT without options), then you will either have to select all the data that the request returned, or release the resource via free (), or pull store_result before fetching ().
But - I repeat - in the current code, this parameter does not make sense and at the same time is the cause of all the troubles.
First, NEVER write this again: die(mysqli_error($mysqli)); otherwise you will become a kid and they will take you into the army.
Instead of die, write trigger_error()
Second, NEVER substitute variables directly into the query string. It is necessary to transfer data only through placeholders . If the native mechanism is too complicated, then you can use the phpfaq.ru/safemysql library and the code will turn out like this.$exists = $db->getOne("SELECT 1 FROM users WHERE social_id=?s",$social_id);
if($exists){
//тут устанавливаются куки
}else{
$db->query("INSERT INTO users (social_id) VALUES (?s)", $social_id);
}
(you don't need to print meaningless okay or oops)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question