0

what is alternative ways to replace , the function function_construct()

<?php class curd { private $conn; //what is the errors below in the function function__construct() { try { $this->conn = new mysqli("localhost", "root","","php_oops"); } catch(Exception $e) { echo "not connected. Try again "; } } public function insert($data) { echo "<pre>"; print_r($data); echo "</pre>"; } } ?>

22nd Jul 2020, 11:59 AM
Nar Bdr Kharka
Nar Bdr Kharka - avatar
2 odpowiedzi
+ 4
Please use appropriate tags for programming language. Thanks!
22nd Jul 2020, 2:21 PM
Lothar
Lothar - avatar
+ 2
If you come across such doubt in the future, between function and construct put space okay. function __cunstruct()
22nd Jul 2020, 12:13 PM
Nar Bdr Kharka
Nar Bdr Kharka - avatar