Tuskony Posted November 24, 2008 Share Posted November 24, 2008 I have a class defined as: define('DEF_HOST', 'localhost'); define('DEF_USER', 'MyUserName'); define('DEF_PASS', 'MyPassword'); define('DEF_DB', 'MyDatabase'); class CDatabase { private $db_user_name; .... } That line, private $db_user_name, gives me the following error: Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /usr/share/pear/xxxxxx/CDatabase.php on line 10 Link to comment https://forums.phpfreaks.com/topic/133959-private-db_host/ Share on other sites More sharing options...
trq Posted November 24, 2008 Share Posted November 24, 2008 What version of php? Link to comment https://forums.phpfreaks.com/topic/133959-private-db_host/#findComment-697349 Share on other sites More sharing options...
Tuskony Posted November 24, 2008 Author Share Posted November 24, 2008 phpinfo() tells me version 4.2.2 Link to comment https://forums.phpfreaks.com/topic/133959-private-db_host/#findComment-697353 Share on other sites More sharing options...
trq Posted November 24, 2008 Share Posted November 24, 2008 Visability operators are only available in PHP5+, Id suggest you upgrade. PHP4 had long been depricated. Link to comment https://forums.phpfreaks.com/topic/133959-private-db_host/#findComment-697358 Share on other sites More sharing options...
Tuskony Posted November 24, 2008 Author Share Posted November 24, 2008 I'll do that thanks!!! This is an old redhat server I setup YEARS ago. Looks like I need to upgrade MySQL as well. My version doesn't support mysql_real_query() lol. Link to comment https://forums.phpfreaks.com/topic/133959-private-db_host/#findComment-697359 Share on other sites More sharing options...
trq Posted November 24, 2008 Share Posted November 24, 2008 I'll do that thanks!!! This is an old redhat server I setup YEARS ago. Looks like I need to upgrade MySQL as well. My version doesn't support mysql_real_query() lol. Funny that, considering theres no such function. Link to comment https://forums.phpfreaks.com/topic/133959-private-db_host/#findComment-697361 Share on other sites More sharing options...
Tuskony Posted November 24, 2008 Author Share Posted November 24, 2008 PHP doesn't support mysql_real_query() and the like? I used those functions in all my C++ apps. Link to comment https://forums.phpfreaks.com/topic/133959-private-db_host/#findComment-697365 Share on other sites More sharing options...
corbin Posted November 24, 2008 Share Posted November 24, 2008 MySQL stuff isn't as difficult in PHP as in C++ (although it's really not too bad in C++). You just need mysql_query() mysql_num_rows() and mysql_fetch_assoc() mainly ;p. Link to comment https://forums.phpfreaks.com/topic/133959-private-db_host/#findComment-697380 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.