Hello, I am new to WebMatrix and MySQL, and I need some assistance with an issue.
I'm trying to code with PHP and MySQL in WebMatrix 3. I am experimenting with scripts in a site file called "Starter PHP site". WebMatrix is not showing a database created with the
$sql="CREATE DATABASE my_db";
script when I navigate to the "Databases" section in the program. This image shows what part of the program I'm talking about.
When I click the "Databases" button in the lower left corner of the UI, all that is shown in the left pane is a "Starter PHP site" folder icon (for creating a MySQL databse for my site from the WebMatrix UI) and an "Other Connections" icon -- but not the database created (my_db) after running the script above.
I know that the database exists...because when I run the script above again with some extras--
$con=mysqli_connect("localhost","xxxx","xxxxxxxx");$sql="CREATE DATABASE my_db";if(mysqli_query($con,$sql)){ echo "Database my_db created successfully";}else{ echo "Error creating database: ". mysqli_error($con);}
--I get an error saying that "my_db" already exists. Why doesn't WebMatrix show my_db in the "Databases" section...after I've run the script to create the database?
What am I missing here?
Any advice is greatly appreciated.