I'm still new to POSTING from an html web form with php to a database, but I think I've been able to piece together everything I need. But something is still missing and I don't know what.
I tested my connection and tables with:
<?php
$link = mysqli_connect("localhost","#user","#password", "#database");
if (!$link) {
echo "Error: Unable to connect to MySQL." . PHP_EOL;
echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
exit;
}
echo "Success: A proper connection to MySQL was made! The my_db database is great." . PHP_EOL;
echo "Host information: " . mysqli_get_host_info($link) . PHP_EOL;
$test_query = "SHOW TABLES FROM" $#database;
$result = mysqli_query($connect, $test_query);
$tblCnt = 0;
while($tbl = mysqli_fetch_array($result)) {
$tblCnt++;
#echo $tbl[0]."<br />
";}
if (!$tblCnt) {
echo "There are no tables<br />
";
} else {
echo "There are $tblCnt tables<br />
";
}
mysqli_close($link);
?>
I've tried 127.0.0.1 and an access host IP (RemoteMySQL) to no avail. My user has full permissions. I'm not aware of any other default security that could be hindering me.
I'm hosting with Bluehost, using MySQL and phpmyadmin. There are 2 tables in my database and they are found when I type "SHOW TABLES" in phpmyadmin. What am I missing? This is beyond my knowledge. I'm at my wits end...
Thank you so much!