Current location: Hot Scripts Forums » HotScripts.com Discussion » Hot Scripts Forum Questions, Suggestions and Feedback » This is wierd scripted is 100% rigth buth output not


This is wierd scripted is 100% rigth buth output not

Reply
  #1 (permalink)  
Old 02-19-11, 05:56 AM
Jornh Jornh is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Question This is wierd scripted is 100% rigth buth output not

I got a code that figurse out if the user have watched that movie already or not now the wierd thing about it it let see if he watched buth not if he didnt watched:

Code:
PHP Code:

$uid $_COOKIE["cookname"];
$tid $torrent["id"];
$con mysql_connect("localhost","jornherm_acbteam","*******");
if (!
$con)
  {
  die(
'Could not connect: ' mysql_error());
  }

mysql_select_db("jornherm_acbteam"$con);
$query5 "SELECT uid, tid FROM torrents_seen WHERE uid = '$uid' AND tid = '$tid'";
$gezien mysql_query($query5);

while(
$row mysql_fetch_assoc($gezien))
{
$uid2 $row['uid'];
$tid2 $row['tid'];
if (empty(
$tid2)) 
{
    echo 
"<img src=\"./images/notseen.png\" border=\"0\">";
} else {
    echo 
"<img src=\"./images/seen.png\" border=\"0\">";
}

DB Structure:

tid,uid

tid=the id of the movie
uid=the username

http://i56.tinypic.com/2qlvpkl.png

Last edited by Jornh; 02-19-11 at 05:59 AM. Reason: Screen added
Reply With Quote
  #2 (permalink)  
Old 02-19-11, 12:08 PM
Jornh Jornh is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Got i solved beceasu ther wasent always a resutl a loop could not started so i did this:

PHP Code:

<?
$uid 
$_COOKIE["cookname"];
$tid $torrent["id"];
$con mysql_connect("localhost","jornherm_acbteam","*******");
if (!
$con)
  {
  die(
'Could not connect: ' mysql_error());
  }

mysql_select_db("jornherm_acbteam"$con);
// select ALL rows
$query "SELECT * FROM torrents_seen WHERE uid = '$uid' AND tid = '$tid'";
$result mysql_query($query);

$num_rows mysql_num_rows($result);
if (
$num_rows == 1)
{
echo 
"<img src=\"./images/seen.png\" border=\"0\">";    

}     

else     

{    

echo 
"<img src=\"./images/notseen.png\" border=\"0\">";    

}


?>
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classified Ads skipper23 Perl 3 11-22-05 02:22 AM
Classified Ads skipper23 Perl 2 12-30-03 03:43 AM


All times are GMT -5. The time now is 09:58 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.