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; } } } ?> Quote 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'; Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.