doing my head in lol

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • nclemale36
    replied
    fixed and closed
    Last edited by nclemale36; 08.06.09, 21:52.

    Leave a comment:


  • crazybrumi
    replied
    Originally posted by brand View Post
    i have some thing like this on my site its looks like this hope this helps dave
    Code:
        $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&amp;who=$item[0]&amp;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

    Leave a comment:


  • crazybrumi
    replied
    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:


  • crazybrumi
    replied
    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
    PHP Code:
    $feat mysql_fetch_array(mysql_query("SELECT id, name FROM dave_users WHERE featured='1'"));
    echo 
    "<a href=\"featured.php?action=main&amp;who=$feat[0]&amp;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.

    Leave a comment:


  • brand
    replied
    Originally posted by nclemale36 View Post
    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

    Leave a comment:


  • nclemale36
    replied
    thats looks like its out of the viewuser profile page anyway .

    Leave a comment:


  • brand
    replied
    Originally posted by nclemale36 View Post
    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
    Code:
    $feat = mysql_fetch_array(mysql_query("SELECT name FROM dave_users WHERE featured='Y'"));
    
    echo "<a href=\"featured.php?action=main&amp;who=$who&amp;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
    Code:
        $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&amp;who=$item[0]&amp;sid=$sid\"$color>$item[1]</a> 
    
    joined: $jdt"; 
          echo "$lnk<br/>";
    this is what i got on my index.php page

    Leave a comment:


  • nclemale36
    started a topic doing my head in lol

    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
    Code:
    $feat = mysql_fetch_array(mysql_query("SELECT name FROM dave_users WHERE featured='Y'"));
    
    echo "<a href=\"featured.php?action=main&amp;who=$who&amp;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."'"));
Working...
X