0

Can someone help me with this error? Trying to get the rid of it but I can't find the solution. Today Im trying to making a database to store a data information. So I want to make some IP Address getting and match it with one column that matching with the IP that PHP Just get but it turns out I get this error

Fatal error: Uncaught PDOException: SQLSTATE[IM002] SQLDriverConnect: 0 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified in C:\wamp64\www\ungame.net\acclogin.php on line 7

Im using MS Acces 2019 with pdo_mysql is available and active and odbc extension active. Im using WAMP Server 3.3.0. Just checking through the phpinfo() and yes the extension are active. This is my PHP Code


<?php
// Get IP Address
$ip = $_SERVER['REMOTE_ADDR'];

// Connect to MS Access
$conn = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=UnGameDataServer.mdb; Uid=; Pwd=;");

// Query for checking are the Ip Address available from ungamedataacc Database
$query = "SELECT * FROM ungamedatacc WHERE ipadd = '$ip'";
$result = $conn->query($query);

// If Ip Address matches
if ($result->rowCount() > 0) {
    // Redirect to other site
    header("Location: site_location.html");
}
?>

Did somebody can find the issue what is going on? Every help appriciated.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
GMarchKun
  • 1
  • 1

0 Answers0