I want to do one project with PHP and Asp.Net. Database is MySql. How can I use the same database for both PHP and Asp.Net Website. Can I do that for this method. If I can, how I can use for the single database for both website. If I am passing values in the sense it will be store in a database from both PHP and Asp.Net Web Application. How I can manage this? If it is possible?
-
just setup connectiong string that points to your db – zxc Nov 07 '13 at 05:35
-
i know the connection of MySql datqabase. now i want to connect with Asp.net to PHPMyAdmin Mysql database – Prem Anandh Nov 07 '13 at 07:08
-
look at this site for c# mysql connection http://stackoverflow.com/questions/10505952/mysql-connection-string-is-not-working-in-c-sharp – zxc Nov 07 '13 at 07:14
-
this is normal C# with Mysql only know – Prem Anandh Nov 07 '13 at 07:21
-
so whats troubling you? if your connection is right then you can do your logic for transactions – zxc Nov 07 '13 at 07:23
-
sir. i want Asp.net with PHPMYADMIN MYSQL not MYSQL WORK BENCH – Prem Anandh Nov 07 '13 at 07:31
5 Answers
you can create same database for any type of application either it's in JAVA or Dotnet or PHP.It doesn't matter.
First try to create a service layer in asp.net for Database CRUD operations. 1) EmployeeService - API service. 1.Insert a new record in the table. 2.Delete the record. 3.Update the record.
Sample to create service layer using WCF service - http://www.codeproject.com/Articles/254714/Implement-CRUD-operations-using-RESTful-WCF-Servic
The above layer can be used for both asp.net and PHP.
2)Asp.Net application - Call the above service using Jquery from asp.net application
3)PHP application - Call the above service using jquery from asp.net application

- 92
- 1
- 8
How can I use the same database for both PHP and Asp.Net Website
For .Net, Setup a connection on your web.config. For PHP, Create a connection file and include that on your files.
Can I do that for this method.
Yes you can.
If I can, how can I use for the single database for both website. if I am passing values in the sense it will be store in a database from both PHP and Asp.Net Web Application. How I can manage this?
You can use the very same database. You just have to write separate coding logics , one for PHP and the other for .Net.

- 19,824
- 17
- 99
- 186

- 68,075
- 43
- 96
- 126
-
-
that separate coding k that is no problem. i want we can write the code for PHPMYADMIN MYSQL Database connectivity? – Prem Anandh Nov 07 '13 at 07:19
http://www.aboutcodes.com/2013/03/connect-mysql-database-to-c-aspnet.html
http://www.aboutcodes.com/2013/03/connect-mysql-database-to-c-aspnet.html
this link for display the CONNECT MYSQL DATABASE TO C# ASP.NET
You can use the Same Database for both PHP and Asp.Net Website.

- 310
- 3
- 9
-
here am using PHPMyadmin for mysql then how i connect with asp.net – Prem Anandh Nov 07 '13 at 06:54
-
but here i am not using Mysql Work bench . just i am using PHPMyAdmin. for the above code possible for connect with PHPMyadmin – Prem Anandh Nov 07 '13 at 07:02
It is possible, but not proffered way.
to do so is as the following.
I suggest that you'll have 3 projects.
- Php project (no database connection)
- Asp.net project (no database connection)
- API project (php / asp) - this project will get requests from the sites (1 and 2) and speak with the db
This situation is really recommended if both php and the asp.net sites are doing the same operations, even if 50% are the same, I recommend you'll do my recomendations.
Edit 1
Ok I think got you
You want to work with ASP.NET but use PHPmyadmin to manage the database.
So if I got you correctly you are developing a ASP.NET app with mysql. and you want to manage the mysql from PHPMYADMIN.
It is possible, but not recommended unless you have php and apache installed.
check this application to manage the mysql database : http://www.mysql.com/products/workbench/
Edit 2 If you still want PHPMYADMIN. You should edit the config.inc.php file of your phpMyAdmin installation.
$cfg['Servers'][$i]['host'] = '';// etc..

- 1,550
- 8
- 8
-
but PHPmyadmin only accept that PHP code only know. then how its accpet it asp.net code – Prem Anandh Nov 07 '13 at 06:57
-
@user2893238 - whtat PHPmyadmin got to do with code. PHPmyadmin is stand alone application. you want to connect to the db from your(!) code, no? – Avi Fatal Nov 07 '13 at 07:03
-
PHPMyadmin stand alone application i know. i need to pass the value from asp.net to PHPMyAdmin MySql. – Prem Anandh Nov 07 '13 at 07:05
-
i saw your edit, but here You are using Mysql work bench know. you dint tell how i can connect with PHPMYADMIN mysql. i don't want mysql work bench – Prem Anandh Nov 07 '13 at 07:14
-
@user2893238 - see my another edit, I cant really understand what is it that you are after – Avi Fatal Nov 07 '13 at 07:20
-
Please. now i have develop one web application with PHP and Mysql.Now i go to develop another one web application in ASP.Net but i don't want to create new database. i am using the same database of PHP application. but here the PHP Application is using PHPMYADMIN MySql database. so how i can connect with PHPMYADMIN to ASP.NET. – Prem Anandh Nov 07 '13 at 07:24
-
-
-
what is the use of edit the config.inc.php file of your phpMyAdmin – Prem Anandh Nov 07 '13 at 07:30
-
-
According to your comments you seem to misunderstand something. PHPMyAdmin is a database management interface for MySQL that just happens to be written in PHP. It is the web equivalent of MySQL WorkBench, which in turn is comparable to MS SQL Server Management Studio.
It is used to manage the databases in your MySQL installation. You can connect to the databases in your MySQL server from any programming language that supports it.
The programming language you use to access the database has no relation at all to PHPMyAdmin or any other program you use to manage your database.

- 147,647
- 23
- 218
- 272
-
okay how i can connect with this PHPMYADMIN MYSQL Database from ASP.Net. Please Help Me. if i pass the value from ASP.NET in the sense it will be save in the database. if i want to retrive the value from PHP means it should work on it. both are running in Same database. please help me. – Prem Anandh Nov 07 '13 at 07:37
-
@user please stop saying PHPMyAdmin as it's irrelevant and confusing. Take a look at http://stackoverflow.com/questions/14801948/how-to-connect-to-mysql-using-c or search the web for "C# MySQL tutorial". – CodeCaster Nov 07 '13 at 07:42
-
Okay. so what ever Database use connection string is important for that one? – Prem Anandh Nov 07 '13 at 07:47
-
Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword; this is the server conncetion . here i put my server name example localhost/phpmyadmin. it is enough??? – Prem Anandh Nov 07 '13 at 07:50
-
i am using wamp server mysql so how i can give the server name of the ASP.NET – Prem Anandh Nov 07 '13 at 08:15