i used this code
<?php $username = "myuser"; $password = "mypass"; $hostname = "myserver";
//connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); echo "Connected to MySQL<br>";
//select a database to work with $selected = mysql_select_db("calendar",$dbhandle) or die("Impossivel seleccionar base de dados");
} //close the connection mysql_close($dbhandle); ?>
for example when i use this if i mistake one numer on server ip it should say unable to connect but instead if gives a 500 error
any any other error with will not show and gives the 500 error
because then i add this and it gives me the 500 error:
//execute the SQL query and return records $result = mysql_query("SELECT Description FROM no_calendar"); echo mysql_errno($result) . ": " . mysql_error($result) . "\n";
also i'm trying to create a new table but it gives an error at last line
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE `aluno` ( `Id` int(11) NOT NULL auto_increment, `idfoto` int(11) character set utf8 default NOT NULL, `idaula` int(11) character set utf8 default NOT NULL, `Nome` varchar(200) character set utf8 default NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
any help is much apreciated