Hi I am starting my final year project and was wanting to know how to connect visual studio to my database. I am using phpmyadmin which is on the uni's server so I can work on it at uni and at home but I am having trouble finding out how I can connect mysql/phpmyadmin to my project.

Any suggestions?

In your title, you mention Visual Studio.. Are you developing PHP using Microsoft Visual Studio? There's no rule that says you cant, but Visual Studio is probably not the best IDE for PHP.

So phpMyAdmin is used to manage your DB, but can you clarify...is your DB at the universitie's network and are you trying to connect to it over the web?

To connect your PHP code to MySQL, you need to specify that information in your code..

$myServer = "MySQLHostName";
$myUser = "userID";
$myPass = "password";
$myDB = "databaseName"; 

// connect to the database
$dbConn = mssql_connect($myServer, $myUser, $myPass) or die("Unable to connet to $myServer"); 

// ... more code ...
// ... more code ...


Im not coding in PHP just using phpmyadmin to manage my database which is on the uni's network and I can connect to it via the internet. It was the uni's suggestion I do it this way as it means I can carry out work at both home and uni.

Okay that's great, I'll give that a go. Thank you :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.