Can somebody explain me exaclty what this part of code actually does? thank you!
$db = ($ENV{'SERVER_NAME'} ne "50free.net")
? DBI->connect("DBI:mysql:nikos_db", "root", "")
: DBI->connect("DBI:mysql:nikos_db:50free.net","nikos_db","macgyver
+")
or print font({-size=>5, -color=>'Lime'}, $DBI::errstr) and exit 0
janitored by ybiC: Retitle form "clarification question"
I also wanted to show you that when i use the above code my index.pl page gives me this error:
Can't connect to local MySQL server through socket '/var/run/mysqld/my
+sqld.sock' (2)
but when i am using the following it works ok!
$db = DBI->connect('DBI:mysql:nikos_db', 'root', '') or
$db = DBI->connect('DBI:mysql:nikos_db:50free.net', 'nikos_db', 'macgy
+ver', {RaiseError=>1});
why is this happening?