doing my head in lol
Collapse
This topic is closed.
X
X
-
Originally posted by brand View Posti have some thing like this on my site its looks like this hope this helps davethis is what i got on my index.php pageCode:$items = mysql_query($sql); if(mysql_num_rows($items)>0) { while ($item = mysql_fetch_array($items)) { $jdt = date("d-m-y", $item[2]); $lnk = "Featured User <a href=\"index.php?action=viewuser&who=$item[0]&sid=$sid\"$color>$item[1]</a> joined: $jdt"; echo "$lnk<br/>";
he only wants one value pulled.that code can do the job but it is ment for something else mainly and in theory would be poor coding as you can do this in 2 lines of code why use several
Leave a comment:
-
if you have the tool for where the member is selected u will need to use 0 and 1 rather than Y and No
Leave a comment:
-
fixed, u had rong database format and using Y and N isnt the best
i have changed the database to name = featured , Type = char (because only one value needs to exist at one time being either 0 or 1) and the default value = 0
then to bring up the data from the databse you was doing it partially write in the code snippet you had but i modiffied it to this
this selects the uid of the person aswell as the name from the sql where featured = 1. when its found them it assign feat[0] to who which will giv the uid and then be able to select users profile and feat[1] which will giv the users username.PHP Code:$feat = mysql_fetch_array(mysql_query("SELECT id, name FROM dave_users WHERE featured='1'"));
echo "<a href=\"featured.php?action=main&who=$feat[0]&sid=$sid\">$feat[1]</a><br/>";
Leave a comment:
-
i have some thing like this on my site its looks like this hope this helps daveOriginally posted by nclemale36 View Posti have made a advanced profile page for wapdesire/ lava where the owners can change the person who is displayed as featured member . its just a simple Y or N in the users table .witrh a new row added being featured ,
so to get the selected user i have used this code
one problem i have is that its only showing a blank profile not the the one of the user that has the Y in the featured part.Code:$feat = mysql_fetch_array(mysql_query("SELECT name FROM dave_users WHERE featured='Y'")); echo "<a href=\"featured.php?action=main&who=$who&sid=$sid\">$feat[0]</a><br/>";
it shows the name as the link correctly. but as i say it shows a blank profile not the profile of that particular user .
i need help to get the code for the who= part of it .
cos its not showing any id number so its obviously not displaying that users profile.
i have tried all this below but it still dont work .
if($who==""||$who==0)
{
$mnick = $_POST["mnick"];
$who = getuid_nick($mnick);
}
$who = $_GET["who"];
$whoinfo = mysql_fetch_array(mysql_query("SELECT id FROM dave_users WHERE featured='".$who."'"));this is what i got on my index.php pageCode:$items = mysql_query($sql); if(mysql_num_rows($items)>0) { while ($item = mysql_fetch_array($items)) { $jdt = date("d-m-y", $item[2]); $lnk = "Featured User <a href=\"index.php?action=viewuser&who=$item[0]&sid=$sid\"$color>$item[1]</a> joined: $jdt"; echo "$lnk<br/>";
Leave a comment:
-
doing my head in lol
i have made a advanced profile page for wapdesire/ lava where the owners can change the person who is displayed as featured member . its just a simple Y or N in the users table .witrh a new row added being featured ,
so to get the selected user i have used this code
one problem i have is that its only showing a blank profile not the the one of the user that has the Y in the featured part.Code:$feat = mysql_fetch_array(mysql_query("SELECT name FROM dave_users WHERE featured='Y'")); echo "<a href=\"featured.php?action=main&who=$who&sid=$sid\">$feat[0]</a><br/>";
it shows the name as the link correctly. but as i say it shows a blank profile not the profile of that particular user .
i need help to get the code for the who= part of it .
cos its not showing any id number so its obviously not displaying that users profile.
i have tried all this below but it still dont work .
if($who==""||$who==0)
{
$mnick = $_POST["mnick"];
$who = getuid_nick($mnick);
}
$who = $_GET["who"];
$whoinfo = mysql_fetch_array(mysql_query("SELECT id FROM dave_users WHERE featured='".$who."'"));Tags: None
Leave a comment: