php - Couldn't display a second word in my database output -


i have strange problem here. i'm doing admin page edit movie info. have movie exemple called "blood diamonds" in database, on oage show "blood" without second word "diamonds", couldnt find whyyy.

require('../classes/movie_class.php'); $moviecinemas = movie::get_movie_info( $_get['movie_id']);  foreach ($moviecinemas $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/>';}     ?> 

in class page :

public static function get_movie_info($movie_id) {     $query = mysql_query(         "select *         movie         movie_id = {$movie_id}"     );      while( $movie =  mysql_fetch_assoc( $query ) )     {         $results[] = $movie;     }      return $results;           } 

the value property in input tags should have quotes surrounding movie name. otherwise, when there's space, interprets next words more properties of input.

echo "<input name='moviename' type='text' id='moviename' value='" . $movie_name . "'><br/>"; 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -