I'm another mysqli newbie to php.
My objective is to retrieve data from a MySql DB and then format and display it in xhtml. In the following php snippet, I've retrieved the contents of
$course_title[1]; but the contents don't get printed out in xhtml and therefore would be unavailable for formatting. How do I interface php variable contents to html?
for ( $i=0 ; $i < $num_rows ; $i++ )
{
$row = @mysqli_fetch_assoc( $result ) ;
echo "<br />" ;
$course_title[$i] = $row['course_title'] ;
echo $course_title[$i] ;
echo "<br />" ;
echo $row[ 'course_title' ] ;
echo "<br />" ;
echo $row['last'] ;
echo "<br />" ;
echo $row['first'] ;
}
@mysqli_free_result( $result ) ;
@mysqli_close( $db ) ;
?>
Hello World
<br>
$course_title[1]