Danny620 Posted September 5, 2009 Share Posted September 5, 2009 Parse error: parse error in C:\xampp\htdocs\class_lib.php on line 20 <?php class connect { var $user = ''; var $pass = ''; var $host = 'localhost'; var $db_name = 'game'; function connect() { $dbc = mysqli_connect($this->host,$this->user,$this->pass,$this->db_name); if (!$dbc) { return ('Could not connect to MySQL: ' . mysqli_connect_error() ); }else{ var $pass = 'Yes'; return $this->pass; } } } ?> Link to comment https://forums.phpfreaks.com/topic/173247-parse-error-parse-error-in-cxampphtdocsclass_libphp-on-line-20/ Share on other sites More sharing options...
wildteen88 Posted September 5, 2009 Share Posted September 5, 2009 Line 20 should read $this->pass = 'Yes'; Not var $pass = 'Yes'; Link to comment https://forums.phpfreaks.com/topic/173247-parse-error-parse-error-in-cxampphtdocsclass_libphp-on-line-20/#findComment-913234 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.