後でデータを分析できるように、php myadmin を使用して簡単な調査を行っています。このコードを実行すると、空白のページが表示されます。問題と解決策は何ですか?私はこのコードを何時間も見つめてきましたが、まだ解決策はありません. XAAMP
<?php
$init_connection = mysql_connect("localdev1.local","user","123" );
mysql_select_db("Word Think",$init_connection);
function displaySurvey ($prompt, $questions){
echo "<td><b>".$prompt."</b><form method=\"post\" action=\"\">"
"<table border=\"0\"/>"
for(i = 0; $i <count($questions) ;$i++){
echo "<tr><td><label><input type=\"radio\" name+\survey\" value=\"".i."\"/>".
$questions[$i]."</label></td></tr>";
}
echo "</table>"
<input type=\"submit\" name=\"submit" value=\"Select Appropriate Response\" />
</form></td></td></table>";
}
$answer_1 = "*SELECT * FROM poll WHERE id = 1";
$process_one = mysql_query($answer_1);
while($row = mysql_fetch_array($process_one, MYSQL_ASSOC)){
$mod_c_one = (int)$row['c_one'] + 1;
$mod_c_two = (int)$row['c_two'] + 1;
$mod_c_three = (int)$row['c_three'] + 1;
$mod_c_four = (int)$row['c_four'] + 1;
}
$choices = array('Definately Yes', 'Yes', 'Undecided', 'No', 'Definately No' );
echo "<table><tr><td><b>Results;</b><table><tr><td>".(mod_c_1-1)."</td><td>".
$choices[0]."<td></tr><tr><td>".($mod_c_2-1)."</td><td>".$choices[1]."</td></tr><tr><td>".
($mod_c_3-1)."</td><td>".$choices[2]."</td></tr><tr><td>".($mod_c_4-1)."</td> <td>".$choices[3]."</td></tr></table></td>";
displaySurvey('Would Your Recomend Your Current Employer', $choices);
if(isset($_POST['sumbit'])){
if(isset($_POST['survey']))
$selection = $_POST['survey'];
else
$selection = "";
if(strlen($selection) > 0){
switch((int)$selection){
case 0:
$select_stmt = "UPDATE survey SET c_1 = $mod_c_1 WHERE id = 1";
case 1:
$select_stmt = "UPDATE survey SET c_2 = $mod_c_2 WHERE id = 1";
case 2:
$select_stmt = "UPDATE survey SET c_3 = $mod_c_3 WHERE id = 1";
case 3:
$select_stmt = "UPDATE survey SET c_4 = $mod_c_4 WHERE id = 1";
}
$process = myswq_query($select_stmt)or die(mysql_error());
if($process)
echo "Thank you for participating";
else
echo "Error";
echo $chocies[$selection];
}else
echo "You have not selected a response yet";
}
?>