I'm trying to teach myself Apache, php, javascript, and mysql from scratch (oh, and phpmyadmin). I'm having problem with getting php to display query results. I've tried more or less straight copying code from a couple different youtube tutorials, but nothing seems to work. I keep getting completely blank webpages. No error messages, no warnings, it's literally a completely blank webpage.
I'm using Apache 2.2.22, php 5.3.10, mysql version 5.5.35-0ubuntu0.12.04.2, and I'm running Ubuntu 12.04. I'll include the code below. I've got one file named infoQuery.php and another named connect.php. They're both in /var/www. This isn't open to the internet, this is just being done on a local virtual machine as a proof of concept before I try a more ambitious project on a hosted server.
connect.php
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpwd = '****';
$db = 'nameEmail';
$conn = mysql_connect($dbhost, $dbuser, $dbpwd);
mysql_select_db($db);
?>
infoQuery.php
<?php
# I've also tried "include 'connect.php';"
include './connect.php';
$query = "SELECT * FROM nameAndEmail";
$result= "mysql_query($query)";
while($person = mysql_fetch_array(result)){
echo "<h3>" . $person['name'] . "</h3>";
}
?>