数据未从Mysql DB显示

时间:2012-05-17 07:04:34

标签: php mysql

我从Webtecher那里得到了这个奇妙的数组结构,但是我正在努力将数据库中的值放到数组中以使它们被选中。

<?php 
$a=array("","2","5","10","20","30","45","60","90","120");
$tsel = 3;  
$tempo = PageDB::getInstance()->get_tempo_by_page_id($pageID);
            echo  '<label style="padding-right:28px;">Tempo</label>
                <select name="tempo">';
for($i=1;$i<sizeof($a);$i++)
{echo '<option value="'.$i.'" '.($tsel==$i?'selected':'').'>'.$a[$i].' Sec</option>';if($tsel==$i)$a[0]=$tsel;}
echo '</select>';?>

如何通过以下查询和语句调用和显示我的页面信息:

 if ($_SERVER['REQUEST_METHOD'] == "POST")
    $page = array("pid" => $_POST['pageID'],
    "message_text" => $_POST['message_text'],
    "message" => $_POST['message'],
    "is_centered" => $_POST['is_centered'],
    "inverted" => $_POST['inverted'],
    "show_time" => $_POST['show_time'],
    "show_temp" => $_POST['show_temp'],
    "tempo" => $_POST['tempo'],
    "transition" => $_POST['transition'],
    "sunday" => $_POST['sunday'],
    "monday" => $_POST['monday'],
    "tuesday" => $_POST['tuesday'],
    "wednesday" => $_POST['wednesday'],
    "thursday" => $_POST['thursday'],
    "friday" => $_POST['friday'],
    "saturday" => $_POST['saturday'],
    "start_date" => $_POST['start_date'],
    "end_date" => $_POST['end_date'],
    "start_time" => $_POST['start_time'],
    "end_time" => $_POST['end_time'],   
    "campaignid" => $_POST['campaignid']);
    else if (array_key_exists('pageID', $_GET)) {
        $page = mysqli_fetch_array (PageDB::getInstance()->get_page_by_page_id($_GET['pageID']));
    } else
        $page = array(
        "pid"=>"",
        "message_text" => "",
        "message" => "",
        "is_centered" => "",
        "inverted" => "",
        "show_time" => "",
        "show_temp" => "",
        "tempo" => "",
        "transition" => "", 
        "sunday" =>"",
        "monday" =>"",
        "tuesday" =>"",
        "wednesday" =>"",
        "thursday" =>"",
        "friday" =>"",
        "saturday" =>"",
        "start_date" => "",
        "end_date" => "",
        "start_time" => "",
        "end_time" => "");

非常感谢任何帮助!

0 个答案:

没有答案