Code doesn’t run in snippit
-
Hi
Been using the [inseret_php] tag pair for ages – tried moving my code into a snippet but I get no output (nor error message).
(Have checked that the snippet is Active and the code is correctly inserted in to the post).$user="php_XXXXXXX"; $password="XXXXXXX"; $database="mantis_XXXXXXX"; mysql_connect("mysql.XXXXXXX.com",$user,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="Select 0 as id, '[CAT]' as ord, 'Version: ', version as description, Case when date_order <= UNIX_TIMESTAMP(now()) then 'released on' else 'release scheduled' end as releaseinfo , DATE_FORMAT(FROM_UNIXTIME(date_order), '%e %M %Y') as released, '' as level,'' as bugnumber, '!',date_order,'' AS NOTES, '[/CAT]' as ord_end from mantis_project_version_table V where (project_id = 8 and /* date_order <= UNIX_TIMESTAMP(now()) and */ date_order > 1270000000 AND version IN (SELECT fixed_in_version FROM mantis_bug_table WHERE severity IN (10,20,25))) UNION Select B.id, '[FEATURE]' as ord,'', case severity when 10 then '(Enhancement)' when 20 then '(Enhancement)' when 25 then '(Enhancement)' else '(Bug Fix) ' end as description , ''as releaseinfo ,'' as released, replace(summary,'%%','%%%%') as level , Concat(' [', format(B.id ,0), ']') as bugnumber, '!',date_order, T.additional_information AS NOTES, '[/FEATURE]' as ord_end from mantis_bug_table B Inner join mantis_project_version_table W on fixed_in_version = W.version INNER JOIN mantis_bug_text_table T on B.id = T.id where (view_state = 10 AND B.Project_Id=8 and /* date_order <= UNIX_TIMESTAMP(now()) AND */ W.Project_Id=8 and date_order> 1270000000) and severity in (10,20,25) order by date_order desc, ord, description desc, level;"; //$query="Select * from mantis_project_version_table"; $result=mysql_query($query); $totalrows=mysql_num_rows($result); //Print "Count=$totalrows\n"; $j=0; for ($i=0; $i<$totalrows; ++$i) { $ord=mysql_result($result,$i,"ord"); $description=preg_replace("/.0$/", ".x", mysql_result($result,$i,"description")); $level=mysql_result($result,$i,"level"); $dateorder=mysql_result($result,$i,"released"); $bugnumber=mysql_result($result,$i,"bugnumber"); $id=mysql_result($result,$i,"id"); $detail=mysql_result($result,$i,"Notes"); $releaseinfo=mysql_result($result,$i,"releaseinfo"); if ($ord == "[CAT]") { ++$j; if ($j%2==0) { $div = "odd"; } else { $div = "even"; } if ($i != 0) { Print " "; } if ($i==0) { Print " <div class='column_accordion'> <div class='accordion'> <div class='mfn-acc accordion_wrapper'> <div class='question active'> <h5 style='padding-bottom: 0px; white-space:nowrap'><span class='icon'><i class='icon-right-open'></i></span> <div class='HTNX_Header$div'>HireTrack NX version $description $releaseinfo $dateorder $level</div>"; Print "</h5> "; Print " <div class='answer' style='display: block;'>"; } else { Print "</div> <div class='question'> <h5><span class='icon'><i class='icon-right-open'></i></span> <div class='HTNX_Header$div'>HireTrack NX version $description released on $dateorder $level</div>"; Print "</h5> "; Print " <div class='answer'>"; }} else { Print " <div class='HTNX_body$div'><a name='$id'></a>$level <small>$bugnumber</small></div> "; if ($detail != "") { Print " <div class='HTNX_Notes$div'> $detail </div> "; } } } Print " </div> </div> </div> </div> </div> </div> ";
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Code doesn’t run in snippit’ is closed to new replies.