我这里有一个奇怪的问题。我正在做一个管理页面来编辑电影信息。例如,我的数据库中有一部名为“Blood Diamonds”的电影,但它只显示“Blood”而没有第二个单词“diamonds”,我找不到whyyy。
require('../classes/movie_class.php');
$moviecinemas = movie::get_movie_info( $_GET['movie_id']);
foreach ($moviecinemas as $movie)
{
$movie_id = $movie['movie_id'];
$movie_name = $movie['movie_name'];
$movie_category = $movie['movie_category'];
$movie_display = $movie['movie_display'];
echo "<input name='movieid' type='hidden' id='movieid' value=" . $movie_id . '><br/>';
echo "Movie Name :";
echo "<input name='moviename' type='text' id='moviename' value=" . $movie_name . '><br/>';
echo "Movie Category :";
echo "<input name='moviecategory' type='text' id='moviecategory' value=" . $movie_category . '><br/>';}
?>
在课堂页面:
public static function get_movie_info($movie_id)
{
$query = mysql_query(
"SELECT *
FROM movie
WHERE movie_id = {$movie_id}"
);
while( $movie = mysql_fetch_assoc( $query ) )
{
$results[] = $movie;
}
return $results;
}