I have this code:
if(!mysql_connect($host,$user,$passwd)){ die("Hoops, error! ".mysql_error()); }
...no error from here.
if(!mysql_select_db($db,$connect)){
$create_db = "CREATE DATABASE {$db}";
mysql_query($create_db,$connect);
mysql_query("USE DATABASE {$db}",$connect);
}
..."no database selected" error from here. I would like to select database if it exists and if doesn't then create it and select it.
Why is my code not right?
Thank you in advance