Hosting web - $movie_header =

$movie_header =<<

Movie Review Database

EOD; 4. Then enter the block of code that was originally there (minus the echo statement). Pay attention to the fact that it s called $movie_header, not $movie (as it was in the first example). $movie_details = ; while ($row = mysql_fetch_array($result)) { $movie_name = $row[ movie_name ]; $movie_director = $row[ movie_director ]; $movie_leadactor = $row[ movie_leadactor ]; $movie_details .=<<

EOD; } $movie_details .=<<

EOD; How It Works The preceding code does quite a lot of work for you, so let s look at it in more detail. As you know, the while { } statement loops through the records that have been returned. For each record, it executes the block of code that is between the brackets. Don t worry; PHP is smart enough to know how many records there are and what record number it is currently on in this case. There is no danger of having the wrong values assigned to the wrong record. The first line within the while loop tells the script to pull out the value of the field movie_name in the current record and put it into a variable called $movie_name. The next four lines do pretty much the same thing they simply assign different field values to differently named variables. 115 Using Tables to Display Data
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision php5 hosting services

Leave a Reply


Movie Title Movie Director Movie Lead Actor
$movie_name $movie_director $movie_leadactor
 
Total :$num_movies Movies