[help]shout like code have error chk it plz

Started on the old forum in April 2013 · view the original in the archive · old links redirect here

1 reply · 398 views · started 13 years ago · 1 min read

2 participants
12345xmen Developer · 239 posts #1

hey guys i try to insert shout like in my ulkoi script......

so for that i

use this this table

table " c_like " and colum "likeid,shoutid,byuser,liketime,chk "

i put this condition if some one like any shout then chk = 1 insert and if dislike chk = 0

for showing shout like and dislke i use below code

$hasLiked=$db->get_row("SELECT * FROM c_like WHERE byuser='$uid' AND chk > 0 ");
if ($hasLiked!=1) {
$like="<img src='".$config->url."images/like.png' /> <b style='color:red;'><a href='like1.php?act=add&sid=".$shout->shoutid."'>Like</a></b>"; } else {
$like="<img src='".$config->url."images/unlike.png' /> <a href='like1.php?act=add&sid=".$shout->shoutid."'>Unlike</a>"; }

$allshouts .= "<tr><td class=\"row1\">» <a href='profile.php?uid=".$shout->userid."'>".$usericon."<font color=\"".$group[$groupid]['color']."\">".$shout->username."</font></a> : ".$shout->message." ($mstime) <br/>                   $like</td></tr>";
   }
     print $allshouts;
     unset($shoutlist);
	 unset($allshouts);
   }

my this code how i excute if some one like to show their unlike and if unlike show again like

$hasLiked=$db->get_row("SELECT * FROM c_like WHERE byuser='$uid' AND chk > 0 "); if ($hasLiked!=1) {

help me for what condition i put in this like........... its ulkoi script....

something else Fellow · 2,296 posts #2

You already have a second condition:

12345xmen wrote: } else { ???

If its not working properly then i would try changing your SQL to:

$hasLiked=$db->get_row("SELECT * FROM c_like WHERE byuser='".$uid."' AND chk > 0 "); 

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close