Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to check if receive new response on the posts that user responsed before?
    primarykey
    data
    text
    <p>Let's say there are 10 posts, and I have sent a response onto 7 of posts. When other user send response to the posts, the system must check and tell me if any 7 of posts receive a new response. The system will not check the other 3 posts, it will check the 7 posts that I have responded only.</p> <p>Step 1 - <code>SELECT post-id FROM responsesLive WHERE username='{$myUsername}';</code> //This will output many duplicated post-id if I sent multiple responses onto a particular post. How to prevent the duplicated post-id?</p> <p>Step 2 - After I get 7 of the post-id, I need to get the response-id of last response in each of the 7 posts. Do I need to use array to store the 7 post-id? Or I just need to write this query within while loop of previous query like :</p> <pre><code>$query3 = "SELECT id FROM responseslive WHERE username='{$myUsername}'"; $result3 = mysql_query($query3,$connection) or die (mysql_error()); confirm_query($result3); while($postinfo = mysql_fetch_array($result3)){ $post-id= $postinfo['post-id']; $query4 = "SELECT rsp-id FROM responseslive WHERE postid='{$post-id}' ORDER BY rsp-id DESC LIMIT 1"; $result4 = mysql_query($query4,$connection) or die (mysql_error()); confirm_query($result3); while($rspinfo = mysql_fetch_array($result4)){ $last-rsp-id= $rspinfo['rsp-id']; } } </code></pre> <p>Step 3 - Then compare current <code>$last-post-id</code> to previous <code>$last-post-id</code>, if current <code>$last-post-id</code> is greater than previous <code>$last-post-id</code>, then tell the user that there is a new response on the post that he have responded before.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload