MySQL - Database Connectivity - Asked By Rajan Shedbalkar on 28-Jan-10 02:24 AM

I have a track page in html. & I also created a database using mySQL. Is it possible to connect my html page to MYSql database.


Pls help me to any other solution.

Database Connectivity - Sagar P replied to Rajan Shedbalkar on 28-Jan-10 02:32 AM

I think you can do it by using simple Ajax; check out this link;

http://w3schools.com/ajax/ajax_database.asp

Or you can do it by usinh PHP like;

<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

// some code
?>

http://www.activewidgets.com/grid.examples/php-mysql.html

http://www.w3schools.com/PHP/php_mysql_connect.asp

connecting to MySql - mv ark replied to Rajan Shedbalkar on 28-Jan-10 02:59 AM

You cannot fetch data from MySQL db to a plain HTML page. You will need to use a server-side programming language like PHP or ASP.NET/C# to connect to MySQL db

There are two main ways to connect to a MySQL database server from .NET: MySQL Connector/ODBC (aka. MyODBC) and MySQL Connector/Net. While the ODBC connector is cross-platform and is compliant with ODBC standards, the .NET version is generally the better choice when using MySQL with .NET.

For detailed steps on getting started with database programming using MySQL & ASP.NET, check this - http://www.15seconds.com/issue/050210.htm

re - Santhosh N replied to Rajan Shedbalkar on 28-Jan-10 03:42 AM

You can do that using AJAX and activex objects and if you dont want any server side technology to be involved, then its not possible and you can check these healthy threads discussing why its not possible and how its not possible as well

http://www.dynamicdrive.com/forums/archive/index.php/t-15629.html

http://www.daniweb.com/forums/thread233881.html#

connecting to MySql - Jitendra Kumar replied to Sagar P on 28-Jan-10 05:26 AM

refer to this site where all most database with connection string are given.

http://www.connectionstrings.com/