Why it's not "if" and not "else"?

Posted by Roman on Stack Overflow See other posts from Stack Overflow or by Roman
Published on 2010-06-16T12:35:24Z Indexed on 2010/06/16 12:42 UTC
Read the original article Hit count: 273

I have this code:

$link = mysql_connect("localhost", "ctmanager", "pswsafgcsadfgG");
if ( ! $link )
   die("I cannot connect to MySQL.<br>\n");
else
    print "Connection is established.<br>\n";
print "a";

if ( mysql_create_db("ct", $link) )
   print "AAA";
else
   print "BBB";
print "2";
die();

And this is the output:

Connection is established.
a

So, I cannot understand how it's possible that neither "AAA" no "BBB" is outputted. Is it because program dies at mysql_create_db?

© Stack Overflow or respective owner

Related posts about php

Related posts about if-statement