Edit 2: Removed incorrect and irrelevant code
FYI: I'm expecting it to be, I am not linking to the correct file location/database.
I'm very new to PHP and MySQL
So I've collected Data from an arduino and stored the data in a CSV file, I've uploaded the file to WAMP server / phpmyadmin.
I'm trying to link up to the database using PHP but get an error: "Connected to MySQL Could not select"
So it cannot seem to find 'sensordata' Here is the code
<?php
$username = "root";
$password = "";
$hostname = "localhost";
$dbhandle = mysqli_connect($hostname, $username, $password)
or die("Unable to connect to mysqli");
echo "Connected to mysqli<br>";
$dbname = "sensordata";
$selected = mysqli_select_db($dbhandle,"sensordata")
//$selected = mysqli_select_db($dbname,$dbhandle)
or die("Could not select");
echo "Connected to sensordata<br>", "<br>";
?>
Any ideas anyone? The file structure can be seen below
", "
"; Not finding sensordata. I have gotten rid of all code below 'echo' connected to sensordata – Brian Geoghegan Jun 09 '16 at 19:06