| Re: Formatting Height |
| by redheadedrod on 2011/1/23 1:04:36 That function is not even close to what would work.. You would have been passing the height to the function which means you dont need the query... And you have to return a variable and you can only do one so you would have to convert it to a string and return the string. The way we worked it out over yahoo should work ok for you. If you would have done something like... le="color: #000000"><?php function getheight($height) { $inches = $height % 12; $feet = ($height - $inches) / 12; return $feet . " ' " . $inches . ' " '; } This MIGHT have worked. Haven't tried something like this with a function yet though. Then you would have called it like... le="color: #000000"><?php $finalheight=getheight($height); Rodney |
| Re: Formatting Height |
| by Arowana on 2011/1/22 23:45:29 EDIT Removed post testing failed |
| Re: Formatting Height |
| by Arowana on 2011/1/22 22:23:28 What is wrong with this function? Willing to hirer someone at this point, anyone got a few minutes that can program this function? le="color: #000000"><?php function getHeight($height){ global $xoopsDB; $query = 'SELECT height FROM ' . $xoopsDB->prefix('xRoster') . ' WHERE id =id'; $inches = $height % 12; $feet = ($height - $height_inches) / 12; }
|
| Re: Formatting Height |
| by Arowana on 2011/1/22 20:35:53 Anyone have some ideas? Sorry pretty stuck here |
| Re: Formatting Height |
| by Arowana on 2011/1/22 7:02:40 can this be put into common.inc.php as a function? le="color: #000000"><?php $height_inches = $height % 12 $height_feet = ($height - $height_inches) / 12 If Yes, how would you right the function xRoster = sql table height = sql row le="color: #000000"><?php function getHeight{ $height_inches = $height % 12; $height_feet = ($height - $height_inches) / 12; }
|