PHP gone wrong: BIG TIME!
Posted: Sun Oct 19, 2008 3:15 am
I have got MANY probz with my php. I didn't know where to post so i just posted here... The problems are these:
first off my php doesn't show any errors whatsoever. Even though setting for showing errors is E_ALL without any exceptions. whenever there is any error the page turns blank.
second I can't get mysql and php connected. I have tried every single code out there.. Nothing is working. I have even tried the W3C's tutorial. Mysql in my computer doesn't have any pass.. Default user is root.
This doesn't work... Even if I remove everything just echo that it is connected... The page turns blank and that in terms of my strange php means an error... HELP OUT!!! I am using latest versions of everything.. Apache, mysql and php.
first off my php doesn't show any errors whatsoever. Even though setting for showing errors is E_ALL without any exceptions. whenever there is any error the page turns blank.
second I can't get mysql and php connected. I have tried every single code out there.. Nothing is working. I have even tried the W3C's tutorial. Mysql in my computer doesn't have any pass.. Default user is root.
Code: Select all
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
if (mysql_query("CREATE DATABASE my_db",$con))
{
echo "Database created";
}
else
{
echo "Error creating database: " . mysql_error();
}
mysql_close($con);
?>