I have a web page that allows you to do a query over a mysql database.
Both html and css are working fine. However, when you submit the query in the localhost, the new page is full blank.
The problem is I´m new with webs, and I don´t know where to start looking. I would guess this is happening due to an error in the conection, but I couldn´t find any problem in my code.
$company = $_POST[´company´];
$brand = $_POST[´brand´];
$servername = "localhost"
$username = "user"
$password = "pass"
$database = "ref"
if ($company == "hyundai") {
$table == "ref_hyundai";
} else if ($company == "fiat") {
$table == "ref_fiat";
} else if ($company == "toyota") {
$table == "ref_toyota";
} else {
$table == "ref_renault";
}
/* Connection to the mysql server and selection of the database */
$db = mysqli_connect($servername, $username, $password) or print_error("The connection to the mysql system is nor working");
mysql_select_db($db, $database) or print_error("The database is not accessible");
/* Query (select) about this brand name */
$query = "SELECT * FROM $table WHERE name LIKE ´%$brand%´;";
$result = mysqli_query($db,$query);
$items = mysqli_affected_rows($db);
if ($items == 0)
{
print_error("The brand $gen wasn´t dounf in the $table table");
}
else {
The rest of the code it´s the display of the results.
Any help would be really appreciated.