jabsalud Posted November 24, 2012 Share Posted November 24, 2012 hey sir i'm thinking of developing an application with mysql as it's database, i'm wondering if how can i connect that database to my php website? for example i am inputting data on my application (that's on my computer) and saved it. and latter on i want that information to be present on my website too. just like one computer application and a web application sharing at one database. so my question is, have you discussed this on your books? any advice regarding to this topic sir? thank you. Link to comment Share on other sites More sharing options...
HartleySan Posted November 24, 2012 Share Posted November 24, 2012 Yes, this is PHP and MySQL 101. This is very easy to do, and Larry talks a lot about it in the book this forum is about. To buy the book, check out the following link: http://www.amazon.co...rds=PHP + MySQL By the way, this book is excellent, and is the one I primarily used to learn PHP and MySQL. Link to comment Share on other sites More sharing options...
jabsalud Posted November 24, 2012 Author Share Posted November 24, 2012 Yes, this is PHP and MySQL 101. This is very easy to do, and Larry talks a lot about it in the book this forum is about. To buy the book, check out the following link: http://www.amazon.co...rds=PHP + MySQL By the way, this book is excellent, and is the one I primarily used to learn PHP and MySQL. Link to comment Share on other sites More sharing options...
jabsalud Posted November 24, 2012 Author Share Posted November 24, 2012 yeah i have red this before and its really good ,it taught me alot about php and mysql and now i am looking forward to take it to more advance. my very concern here is how will you connect the same database you use in programming application. for example you are programming visual basic and you use mysql as its database how will you connect that database to also use in php web developing. what i mean here is that the database is in your local computer and i want my www.example.com to fetch all informations inputted in my local computer at my home. how can i do that? Link to comment Share on other sites More sharing options...
HartleySan Posted November 24, 2012 Share Posted November 24, 2012 I'm not sure how MySQL ties in with desktop applications, but I'm sure there are ways to connect to MySQL DBs from Visual Basic as well. I'd do a search on Visual Basic pages for how to connect to a MySQL DB. Link to comment Share on other sites More sharing options...
Antonio Conte Posted November 24, 2012 Share Posted November 24, 2012 MySQL ties in perfectly with desktop applications. I've never done in Visual Basic per se, but I've done this in Java. A quick online search tells me you need to download the MySQL connector/Net 5.2 from MySQL. This is a driver that will let you connect to a MySQL database. You import this driver into your project, and add a connection function approximately as shown below: Public Sub TestConnection() Try Dim connStr As String = "Database=world;" & _ "Data Source=YOUR_MYSQL_HOST;" & _ "User Id=YOUR_MYSQL_USER;Password=YOUR_MYSQL_PASSWORD" Dim connection As New MySqlConnection(connStr) connection.Open() connection.Close() MsgBox("Connection is okay.") Catch ex As Exception MsgBox(ex.Message) End Try End Sub Switch out the uppercased words with your connect info, just like with PHP. In other words, It's your Mysql host, username, and password. Call the TestConnection() function to perform a connection. Now you can run normal SQL queries against this DB. 1 Link to comment Share on other sites More sharing options...
jabsalud Posted November 25, 2012 Author Share Posted November 25, 2012 thanks for the reply guys especially to you Antonio Conte. you gave me an idea and i'll research on that. Link to comment Share on other sites More sharing options...
Recommended Posts