Jump to content

abrew

Members
  • Posts

    16
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

abrew's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all,,, i have to hide a column(LOCATION) that may not be seen for user level 3 or below i have like this ID Name Location Sex , , , | | | | | | | | how to do it ,,, any one would like to help me please ??? Thank you ,,,
  2. wow wow ,,, as i said i'm beginer ,,, thanx a lot for help ,,, jcbones & mahngiel ,,, thx
  3. hi again the beginers asking some help here ,,, when i echo '<pre>'.print_r($results, 1).'</pre>'; it is look like this Array ( 0 => array ( [id]=>101 [year]=>2011 [month]=>11 [in]=>25 ) 2 => array ( [id]=>105 [year]=>2011 [month]=>12 [in]=>3 ) ,,, ) how to pick and show the value '25' only [in] => 25 any sugestion please ,,, ??
  4. wow ,,, barrand is realy good thanx a lot ,,, this is correct 1000%
  5. i think i can make this ,,, IF r.dayset=1 { SELECT r.ID, r.Year, r.Month, r.dayset, r.TotRain, a.dayset as A, b.dayset as B, c.dayset as C FROM dasharian r LEFT JOIN dasharian as a ON a.dayset = r.dayset AND a.TotRain > 10 LEFT JOIN dasharian as b ON b.dayset = a.dayset+1 AND b.Month=a.Month AND b.TotRain > 10 LEFT JOIN dasharian as c ON c.dayset = b.dayset+1 AND c.Month=b.Month AND c.TotRain > 10 WHERE r.Year='2010' AND a.dayset IS NOT NULL AND b.dayset IS NOT NULL AND c.dayset IS NOT NULL } elseif r.dayset=2 { SELECT r.ID, r.Year, r.Month, r.dayset, r.TotRain, a.dayset as A, b.dayset as B, c.dayset as C FROM dasharian r LEFT JOIN dasharian as a ON a.dayset = r.dayset AND a.TotRain > 10 LEFT JOIN dasharian as b ON b.dayset = 3 AND b.Month=a.Month AND b.TotRain > 10 LEFT JOIN dasharian as c ON c.dayset = 1 AND c.Month=b.Month+1 AND c.TotRain > 10 WHERE r.Year='2010' AND a.dayset IS NOT NULL AND b.dayset IS NOT NULL AND c.dayset IS NOT NULL } elseif r.dayset=3 { SELECT r.ID, r.Year, r.Month, r.dayset, r.TotRain, a.dayset as A, b.dayset as B, c.dayset as C FROM dasharian r LEFT JOIN dasharian as a ON a.dayset = r.dayset AND a.TotRain > 10 LEFT JOIN dasharian as b ON b.dayset = 1 AND b.Month=a.Month+1 AND b.TotRain > 10 LEFT JOIN dasharian as c ON c.dayset = 2 AND c.Month=b.Month+1 AND c.TotRain > 10 WHERE r.Year='2010' AND a.dayset IS NOT NULL AND b.dayset IS NOT NULL AND c.dayset IS NOT NULL } but it's wrong ,,, is anybody can show me where it's WRONG ??? any help please ,,,, ???
  6. Thx again barran ,,, but still the problem is dayset is not a date ( that is not time series not like a DATE) but the dayset is just has 3 number repeatedly like this <i attach the example dataset> Month dayset 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3 | | | | 12 1 12 2 12 3 do you got what i mean ,,, sorry for my bad explanation ,,, sugestion please ,,,,
  7. thanx abdbuet ,,, the code you give is not what i meant ,,, becouse dayset not consecutively grouped if we make it by your code the result is yes the 3 totrain that's > '20' but it's grouped not consecutively i need the dayset to be consecutive thanx other sugestion please ,,,,
  8. Thx Drummin 4 u'r clue ,,, limit not counting the "3 consecutive value" that i need Thx Barrand ,,, u'r clue is very good but i'm wrong gave u example of my table becouse the "dayset" is not time series but it's dayset is only 1-2-3 (it's date 1-10, 11-20, 21-end) it is actualy like this (for data in Year 2010): ID Year Month dayset TotRain 1220 2010 1 1 12 1220 2010 1 2 9 1220 2010 1 3 22 1220 2010 2 1 25 1220 2010 2 2 45 1220 2010 2 3 15 1220 2010 3 1 55 1220 2010 3 2 40 1220 2010 3 3 21 1220 2010 4 1 10 1220 2010 4 2 33 1220 2010 4 3 31 | | | | | | | | | | | | | | | 1220 2010 12 3 18 so u'r clue is not working with my problem ,,, i think becaouse the dayset is not time series any sugestion please ,,, ??? anyway thank you for helping
  9. i have table database like this Dayset Totrain 1 12 2 0 3 21 4 33 5 25 6 24 i need to get the 4th "dayset" after 3 consecutive Totrain > 20 for the data abobve ,,, 3 consecutive TotRain > 20 is ; 21 ,,, 33 ,,, 25 so i need to show that the 4th dayset is " dayset 6 " any sugestion please ,,, ???
  10. hi again ,,, i need help again (as beginers) ,,, plizz i'm going to run percentile function that i found by googling it's work well with the example ,,, here's the script ; require_once("../lib/Stat.class.php"); $stat = new Stat(); $data = array(12,34, 21, 14, 23, 56); echo "data = ".$data."<br />"; echo "25th Percentile = ".$stat->percentile($data,25)."<br />"; echo "Median (50th percentile) = ".$stat->median($data)."<br />"; echo "95th Percentile = ".$stat->percentile($data,95)."<br />"; echo "quartile(25th, 50th, 75th percentile) = ".implode(", ", $stat->quartiles($data))."<br />"; but i need to use this function to calculate my data on database so i do like this require_once("../lib/Stat.class.php"); $stat = new Stat(); $T10p = "SELECT MaxTemp FROM monthly_syn"; $T10pqres = mysql_query($T10p); $data = mysql_fetch_array($T10pqres); // $data = array(12,34, 21, 14, 23, 56); echo "data = ".$data."<br />"; echo "25th Percentile = ".$stat->percentile($data,25)."<br />"; echo "Median (50th percentile) = ".$stat->median($data)."<br />"; echo "95th Percentile = ".$stat->percentile($data,95)."<br />"; echo "quartile(25th, 50th, 75th percentile) = ".implode(", ", $stat->quartiles($data))."<br />"; and the result is wrong ,,, is that because of MYSQL_FETCH_ARRAY ,,, ??? i think mysql_fetch_array will get the same result as array <this make me confuse> please any idea ??? here's the stat.class.php ; <?php class Stat{ function median($data){ $median = $this->percentile($data,50); return $median; } function percentile($data,$percentile){ if( 0 < $percentile && $percentile < 1 ) { $p = $percentile; }else if( 1 < $percentile && $percentile <= 100 ) { $p = $percentile * .01; }else { return ""; } $count = count($data); $allindex = ($count-1)*$p; $intvalindex = intval($allindex); $floatval = $allindex - $intvalindex; sort($data); if(!is_float($floatval)){ $result = $data[$intvalindex]; }else { if($count > $intvalindex+1) $result = $floatval*($data[$intvalindex+1] - $data[$intvalindex]) + $data[$intvalindex]; else $result = $data[$intvalindex]; } return $result; } function quartiles($data) { $q1 = $this->percentile($data,25); $q2 = $this->percentile($data, 50); $q3 = $this->percentile($data, 75); $quartile = array ( '25' => $q1, '50' => $q2, '75' => $q3); return $quartile; } } ?>
  11. Thank you barrand ,,, u'r the man ,,, that's all i need !!! david it's good 2 ,,, but i use barrand clue ,,, thank all
  12. almost like that Barrand 10-day ecaxtly like this January ; 1 ------- 10 11 -------20 21 -------31 (end of month) February ; 1--------10 11------20 21------28 or 29 (the end of the month) the last 10-days is not always 10 day ,,, depend on the month thx , any idea ??
  13. thx John ,,, but u'r query result only one output i mean i need it Total Rain every (10-day) for all long data such from year 2000 to 2012 so the output will be like this TIME Rain tenday-1 10 tenday-2 5 tenday-3 32 , , , any more idea ???
  14. hi i have daily data table it's contain ID, Date, and Rain i need to make a new table but tendays period ,,, any clues ,,, will be very greatfull thanks a lot ,,,
  15. wow ,,, thanx a lot SILKFIRE & XYPH ,,, it's been a week with headache !!! i don't know that mysql_query cannot run more than 1 ,,, thx MASTER !!! it's all DONE !!! THANK YOU SO MUCH ,,,
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.