-3

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?

halfer
  • 19,824
  • 17
  • 99
  • 186
Prem Anandh
  • 23
  • 1
  • 2
  • 8

5 Answers5

1

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

Wiki
  • 92
  • 1
  • 8
0

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.

halfer
  • 19,824
  • 17
  • 99
  • 186
Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126
0

http://www.aboutcodes.com/2013/03/connect-mysql-database-to-c-aspnet.htmlhttp://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.
shafi
  • 310
  • 3
  • 9
0

It is possible, but not proffered way.
to do so is as the following.

I suggest that you'll have 3 projects.

  1. Php project (no database connection)
  2. Asp.net project (no database connection)
  3. 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..
Avi Fatal
  • 1,550
  • 8
  • 8
0

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.

CodeCaster
  • 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