doing my head in lol

Started on the old forum in May 2009 · view the original in the archive · old links redirect here

7 replies · 445 views · started 17 years ago · 1 min read

3 participants
nclemale36 Lead · 537 posts #1

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

$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/>";

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.

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."'"));

brand Senior · 391 posts #2

nclemale36 wrote: 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

$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/>";

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.

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."'"));

i have some thing like this on my site its looks like this hope this helps dave

    $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/>";

this is what i got on my index.php page

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

brand Senior · 391 posts #4

nclemale36 wrote: thats looks like its out of the viewuser profile page anyway .

no its off my index.php page the main page thats what i have on me main page when i log in to site its under me shout box

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

crazybrumi Super moderator Principal · 1,064 posts #5

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

$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/>";

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.

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

crazybrumi Super moderator Principal · 1,064 posts #7

brand wrote: i have some thing like this on my site its looks like this hope this helps dave

    $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/>";

this is what i got on my index.php page

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

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

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