Once you've called msql_query and assigned the result to a variable, the variable then represents a resource that points to the actual result. There are two ways you can approach this problem, the first would be to print the error and continue on with the script anyway. To do this you would use code like this:
$table = mysql_query("CREATE TABLE poop (age INT, name VARCHAR[15])");
if(is_resource($table)) {
echo "<P>Created successful!</P>";
} else {
echo("<P>Error: ". mysql_error() . "</P>");
}
However, if you want to kill the script if there's an error you can use considerably less code:
$table = mysql_query("CREATE TABLE poop (age INT, name VARCHAR[15])")
or die("Error: " . mysql_error() . "</P>");
Check out the manual on mysql and resources for more information