Note that there are some explanatory texts on larger screens.

plurals
  1. POif mysql result does not exist echo?
    primarykey
    data
    text
    <p>Hi ive got a basic likes system on my site. Basically once the user clicks like, this sets user_id-has_liked to 1 from 0.</p> <p>if their user_id_has_liked is set to 0 it displays the like link, if its set to 1 it displays unlike. however i want to add another condition that says if result is not in mysql then echo out the like link.</p> <p>can someone show me where and what i would add to make this happen please. </p> <pre><code>&lt;div class="profile_likes"&gt; &lt;?php $user_like_set = user_like_status(); while ($like = mysql_fetch_array($user_like_set)) if ($like['user_id_has_liked'] == '0') { ?&gt; &lt;a href="like_profile.php?to=&lt;?php echo "$profile_id"; ?&gt;"&gt;Like&lt;/a&gt;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&lt;? $count_likes_set = count_likes(); while ($likes = mysql_fetch_array($count_likes_set)) { echo "". $likes['likes'] ." People Like ".$profile[2].""; //$check_new_duos_set = check_new_escort_duos(); while ($newd = mysql_fetch_array($check_new_duos_set)) { ?&gt; &lt;? } }?&gt; &lt;?php $user_like_set = user_like_status(); while ($like = mysql_fetch_array($user_like_set)) if ($like['user_id_has_liked'] == '1') { ?&gt; &lt;a href="unlike_profile.php?to=&lt;?php echo "$profile_id"; ?&gt;"&gt;Unlike&lt;/a&gt;&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&lt;? $count_likes_set = count_likes(); while ($likes = mysql_fetch_array($count_likes_set)) { echo "". $likes['likes'] ." People Like ".$profile[2].""; //$check_new_duos_set = check_new_escort_duos(); while ($newd = mysql_fetch_array($check_new_duos_set)) { ?&gt; &lt;? } }?&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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