Hi,
I have the following PhP string. The code is writen to include statistical average on "nummeric values" such as 5, 3, 2, 1.... n will be calculated as 5 + 3 + 2 + 1 / n = XYZ / n.. However, it is not working properly..
The star numeric values ( 2, 5, etc. etc. ) will be entered by the user.
It would be very kind of him/her if anybody can help me with this problem. If it takes too much of your time financial compensation is possible.
I have been trying to solve this problem for 6 months..
Regards,
Korkut Vata
status; $sid = $gas_res->sid; / Get Stars / if(strpos($output,'') > 0){ preg_match('/[0-9 ]+[*]/',$output,$matches); if(intval($matches[0])!=0){ $start_value = str_replace('','',$matches[0]); } else{ preg_match('/[*][0-9]+/',$output,$matches1); $start_value = str_replace('','',$matches1[0]); } } else{ $star_value = ""; } $star_value = trim($start_value); / Get Stars / / Get Tags / $sql_exe = db_query('SELECT name from tags WHERE type="term" AND sid='.$sid); while($sql_obj = db_fetch_object($sql_exe)){ $tag_name = $sql_obj->name; if($tag_name!="" && $star_value!=""){ $sql_2 = 'INSERT INTO rating VALUES('.$sid.',"'.$tag_name.'",'.$star_value.')'; db_query($sql_2); } } / Get Tags */ } ?>