hi im trying to connect to mysql with a php script and the result is i get nothing on the result page but the <h1>headings<h1>. i know ive used root but this is only for testing purposes.
<?php
trim($firstName);
trim($lastName);
trim($age);
if(!$firstName || !$lastName || !$age) {
echo "you did not enter all the values<br>";
exit;
}
$firstName = addslashes($firstName);
$lastName = addslashes($lastName);
$age = intval($age);
@ $db = msql_pconnect("localhost", "root", "password");
if(!$db) {
echo "Error: could not connect to the msql database<br>";
exit;
}
echo "connection to the database was a success<br>";
?>
could this be a problem with how i have configured apache, php or mysql. any help would be much appreciated.
i get the same result if i use mysql_connect, im told that mysql_pconnect is the same thing except that when you open a connection to a mysql server the connection doesnt shut when your script finishes. so then if you have to make a connection again you already have one. i think the p stands for persistant. or something like that. im new to php.