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?

4 Years
Discussion Span
Last Post by laura301019

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 ...


Edited by JorgeM


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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.