Can't create table (errno: 150) on FOREIGN KEY
问题 I saw a lot of same question but I couldn't solve my case. If I run this code: <?php include_once($_SERVER['DOCUMENT_ROOT'].'/config.php'); $servername = HOST; $username = USERNAME; $password = PASSWORD; $dbname = DB; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } // sql to create table $sql = "CREATE TABLE IF NOT EXISTS Articls ( id INT(10) UNSIGNED AUTO