Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help with a simple function

    Hey all, new here; no idea where to post. Heh, so I am a failure at writing functions; as I have not studied much on them.. Basically I am trying to make New = 1 and Used = 0 so it will post in place with a simple $coach_meta.. I know it is easy, but hey, I suck.

    Code:
    function coach_meta2 ($nu = '') {
    
    	global $dbh;
    
        $output = '';
    	$coach_meta = coach_meta($data['ID']);
    		$nu = ($coach_meta['ecpt_newused']);
    
    if ($nu = "New") { 
    
    $nu = "1";
    
    }
    else 
    {
    	if ($nu = "Used") {
    
    	$nu = "0";
    	
    }
    
            $nu = mysql_query($query);
    
            while($data2 = mysql_fetch_assoc($nu)) {
                $output = $data2;
            }
    
    
        }
    
        return $output;
    
    }
    Anyone care to help an noob? haha

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Umm, why did you create a new account just to post this?
    I replied to your other thread which I restored and moved into the proper forum here: http://www.codingforums.com/showthread.php?t=281290


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •