Undefined Property in connection to MySQL

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Undefined Property in connection to MySQL

Postby mindaji » 15. March 2016 21:37

Hi, Guys:
I have installed XAMPP for Windows 5.5.33, 5.6.19 & 7.0.4 for very test of connection to MySQL. However I always hit the error of "Undefined Property":

Undefined property: mysqli::$conect_error in D:\xampp\htdocs\learnphp\Ex_Files_PHP_forWD\Ex_Files_PHP_forWD\Exercise Files\hanselandpetal\mixed\mixed.php

The following is the code for the connection:

<?php
$message = '';

$db = new mysqli('localhost', 'phpwebdes', 'lynda', 'hanselandpetal');
if ($db->conect_error) {
$message = $db->connect_error;
}
else {
$message = 'Connection is OK';
}
?>

<html>
...

<?php if ($message){
echo "<h2>$message";
} ?>

</html>

Has anyone come across the same problem? Anyone can help resolve this issue?

MInda
mindaji
 
Posts: 2
Joined: 15. March 2016 21:12
Operating System: Windows 8.1

Re: Undefined Property in connection to MySQL

Postby JJ_Tagy » 15. March 2016 22:40

mindaji wrote:if ($db->conect_error) {


Connect is spelled with 2 x 'n' characters.
JJ_Tagy
 
Posts: 788
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: Undefined Property in connection to MySQL

Postby mindaji » 16. March 2016 17:36

Thanks for your help! It is very spelling error that caused the confusing error!
mindaji
 
Posts: 2
Joined: 15. March 2016 21:12
Operating System: Windows 8.1


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 205 guests