took this straight from
http://www.w3schools.com/php/php_mysql_connect.asp
In the following example we store the connection in a variable ($con) for later use in the script. The "die" part will be executed if the connection fails:
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}// some code
This is bogus code --- when you run it it says
Parse error: syntax error, unexpected T_STRING in /home/kenbob/public_html/form/db_create_table.php on line 9
It does not DIE and print off the script code "could not connect"
Does this site use a different PHP verison?
http://www.w3schools.com/php/php_mysql_connect.asp
In the following example we store the connection in a variable ($con) for later use in the script. The "die" part will be executed if the connection fails:
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}// some code
This is bogus code --- when you run it it says
Parse error: syntax error, unexpected T_STRING in /home/kenbob/public_html/form/db_create_table.php on line 9
It does not DIE and print off the script code "could not connect"
Does this site use a different PHP verison?
Last edited: