brown2005 Posted December 8, 2006 Share Posted December 8, 2006 if(isset($_SESSION['MemberID'])) { $rank = 1; $adverts_query = "SELECT * FROM adverts ORDER BY adverts_link_amount DESC, adverts_link_date ASC"; $adverts_result = mysql_query($adverts_query) or die (mysql_error()); while ($adverts_array = mysql_fetch_array($adverts_result, MYSQL_ASSOC)) { $adverts_id = $adverts_array['adverts_id']; $adverts_link = $adverts_array['adverts_link']; $adverts_link_url = $adverts_array['adverts_link_url']; $adverts_link_amount = number_format($adverts_array['adverts_link_amount']); $adverts_link_date = explode(" ",$adverts_array['adverts_link_date']); $adverts_link_date_date = $adverts_link_date[0]; $adverts_link_date_time = $adverts_link_date[1]; $rankStr = ordSuffix($rank); $adverts_seen_query = "SELECT * FROM adverts_hits WHERE adverts_hits_user='$session_id' AND adverts_hits_website='$adverts_id ';"; $adverts_seen_rows = mysql_num_rows($adverts_seen_query); if($adverts_seen_rows > 0) { echo' <tr onmouseover="ChangeColor(this, true);" onmouseout="ChangeColor(this, false);" onclick="DoNav('.$config_website_url.'/'.$config_website_url_topic.'/files/url.php?id='.$adverts_id.');"> <td align="center" class="text_bold_seen" height="30">'.$rankStr.'</td> <td align="center" class="text_bold_seen"><a href="'.$config_website_url.'/'.$config_website_url_topic.'/files/url.php?id='.$adverts_id.'" class="blue_bold_none" target="_blank">'.$adverts_link.'</a></td> <td align="center" class="text_bold_seen">'.$adverts_link_date_date.'<br>'.$adverts_link_date_time.'</td> <td align="center" class="text_bold_seen">£ '.$adverts_link_amount.'</td> </tr>'; $rank ++; } } } Quote Link to comment Share on other sites More sharing options...
papaface Posted December 8, 2006 Share Posted December 8, 2006 What error do you get? Quote Link to comment Share on other sites More sharing options...
brown2005 Posted December 8, 2006 Author Share Posted December 8, 2006 what it is suppose to do is change the background color of the row if it has been seen... Quote Link to comment Share on other sites More sharing options...
Orio Posted December 8, 2006 Share Posted December 8, 2006 What's this line?$rankStr = ordSuffix($rank);There's no function called ordSuffix in php, and I dont see you decalaring it...Orio. Quote Link to comment Share on other sites More sharing options...
brown2005 Posted December 8, 2006 Author Share Posted December 8, 2006 it is a function i have written myself which i have included in it.. it prints this out fine... Quote Link to comment Share on other sites More sharing options...
brown2005 Posted December 8, 2006 Author Share Posted December 8, 2006 $adverts_seen_query = "SELECT * FROM adverts_hits WHERE adverts_hits_website='1' AND adverts_hits_user='1'"; $adverts_seen_rows = mysql_num_rows($adverts_seen_query); echo $adverts_seen_rows;the problem is that, as it doesnt echo nething at all, but i dont see it... ne ideas? Quote Link to comment Share on other sites More sharing options...
taith Posted December 8, 2006 Share Posted December 8, 2006 you still need to query that...[code]$adverts_seen_query = "SELECT * FROM adverts_hits WHERE adverts_hits_website='1' AND adverts_hits_user='1'"; $result=mysql_query($adverts_seen_query);$adverts_seen_rows = mysql_num_rows($result); echo $adverts_seen_rows;[/code] Quote Link to comment Share on other sites More sharing options...
brown2005 Posted December 8, 2006 Author Share Posted December 8, 2006 $adverts_seen_query = mysql_query("SELECT * FROM adverts_hits WHERE adverts_hits_website='1' AND adverts_hits_user='1'");god i feel thick now, missed the magic mysql_query() Quote Link to comment Share on other sites More sharing options...
brown2005 Posted December 8, 2006 Author Share Posted December 8, 2006 yes taith, thank you very much, i cant believe i didnt spot it... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.