
acegames
Members-
Posts
32 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
acegames's Achievements

Newbie (1/5)
0
Reputation
-
Thanks , sorry I did not post the full code just what I was working on I now think the error is elsewhere as I have duplicate entries for friendid requesterid & requesterid friendid
-
I am trying to select from a friends table where either the requester id or friend id is the userid ($id) and approved is 1 I get the results but I cant manage to get it to show the correct username for all results , if the requester id is the $id I want it to show the friendid and if the friendid is the $id I want it to show the requester id $psql = mysql_query("SELECT * FROM `friends` WHERE (requesterid='".$id."' OR friendid='".$id."') AND `approved`='1' LIMIT $startt , 20;", $conn); if($num1>0) { while($buds=mysql_fetch_array($psql)) { $r = $buds["requesterid"]; if($r[requesterid]==$id) { $r = $buds["friendid"]; if($r[friendid]==$id) { $r = $buds["requesterid"]; } }
-
Can anyone help me with this code please I need to add this query to the code so it gets results where friendid and requesterid both are approved ="1" $psql = mysql_query("SELECT * FROM `friends` WHERE `friendid`='$id' AND `approved`='1'", $conn); $psql = mysql_query("SELECT * FROM `friends` WHERE `requesterid`='$id' AND `approved`='1'", $conn); $num = mysql_num_rows($psql); $psql = mysql_query("SELECT * FROM `friends` WHERE `requesterid`='$id' AND `approved`='1' LIMIT $start , 5;", $conn); $left = mysql_num_rows($psql); ?> <? if($num>0) { while($prow = mysql_fetch_array($psql)) { $r = $prow["friendid"]; $n="navItem1"; $x=$x+1; if($x%2==0) { $n="navItem2"; } $sql1 = mysql_query("SELECT * FROM `members` WHERE `id`='$r'", $conn); while($row1 = mysql_fetch_array($sql1)) { $av = $row1["avatar"]; } if($av) { $av = "<a href=\"profile.php?id=$r\"><img src=\"$av\" class=\"img\" /></a>"; } else { $av = "<a href=\"profile.php?id=$r\"><img src=\"default.gif\" class=\"img\" /></a>"; }
-
Thanks for the quick reply but I tried that and I just get a value of zero
-
Hello I have 2 tables : blog with , id , uid , title , entry , date blog_comments with , id , uid , bid , date comment With the following code I need to add a line to : query the table blog to get the uid where blog id = $bid I have tried but cant get it to work at all and was hoping for some help <? $sql = mysql_query("SELECT * FROM `blog_comments` ORDER BY `date` DESC LIMIT 5;", $conn); while($row = mysql_fetch_array($sql)) { $comment = $row["comment"]; $uid = $row["uid"]; $bid = $row["bid"]; $date = $row["date"]; $coms = mysql_num_rows(mysql_query("SELECT * FROM `blog_comments` WHERE `bid`='$bid'", $conn)); $n = "navItem2"; print "<div class=\"$n\"><a href=\"profile.php?id=$uid\">" . Username($uid) . "</a> Said <a href=\"blog.php?a=3&bid=$bid&id=$blog\">$comment $blog $title</a> on " . MakeDate($date) . "; ($coms Comments) </div>"; } ?>
-
Thanks , Im trying to learn as I go , just having a bad day today
-
Thanks , I dont know how to now add if $site=1 to set it to echo "SITE 1"
-
Hello , I am trying to set each site with $site=1 $site=2 $site=3 etc and passing that to a download page On the download page I want to add something like "If site = 1 then I can echo "Site 1" "If site = 2 then I can echo "Site 2" How would I do that ?
-
thanks , that worked
-
Thanks for your reply I have made some changes and it is all working now except on my download page I echo the $page as a back link and it is using the url in the browser for some reason with the $page variable on the end This is how im trying to display it : <div class="header"><a href="<?php echo"$page" ?>">Back</a></div> But its linking to :http://www.domain.com/Download/Lady+Gaga+Paparazzi/mp3/12526/mp3-testing.php/mp3-testing.php?start=10 Instead of to :http://www.domain.com/mp3-testing.php?start=10 If I just echo the $page variable I get : mp3-testing.php?start=10
-
I now have it working , I changed :$page = ($_SERVER['REQUEST_URI']); to:$page = "mp3.php"; Is there a way to get the page name without the $start= on the end ?
-
Just to add , the $page= which is giving me the problems I am getting like this : $page = ($_SERVER['REQUEST_URI']);
-
I have made my urls friendly with modrewrite but I am stuck on the last part My code is displaying : Download-DJ+Webstar+Feat+Jim+Jones+Dancing+On+Me-mp3-12525-/mp3.php?start=10-10.htm But needs to be like this to work : Download-DJ+Webstar+Feat+Jim+Jones+Dancing+On+Me-mp3-12525-/mp3.php-10.htm My htaccess : Options +FollowSymLinks RewriteEngine on RewriteRule Download-(.*)-(.*)-(.*)-(.*)-(.*)\.htm$ download-url.php?filename=$1&table=$2&id=$3&page=$4?start=$5 My page code : <a href="Download-<?php echo $uListName ?>-<?php echo $table ?>-<?php echo $fileID ?>-<?php echo $page ?>-<?php echo $start ?>.htm"><?php echo $ListName ?><br /></a> <? $i++; } if($numrows > ($start + 10)) { echo "<a href=\"" . $_SERVER[php_SELF] . "?start=" . ($start + 10) . "\">Next Page</a><br/>\n"; } else { echo ""; } if($start > 0) { echo "<a href=\"" . $_SERVER[php_SELF] . "?start=" . ($start - 10) . "\">Previous Page</a><br/>\n"; } else { echo ""; } echo"</p>"; ?> Could somebody please give me any pointers as to where I have gone wrong It all works apart from when I click on next page and then the url is $start=10
-
Yes me too , Thanks for your time on this one
-
Yes its all correct , I did a test with two pages with a tutorial on the net and it worked fine , so mod_rewrite is working ok