I'm going to use PHP to connect to MySQL in my program, so I'll have to copy it to the php.ini under C:windows.
to Extension=php_mysql.dll the front; Semicolon to remove.
Phpexe php_mysql.dll files, also copied to C:windows, or is already set in the path path.
And then. You can use the following section of the code to test whether the normal connection.
Native Environment: Mysql-4.1.22-win32
Mysql:root Password 123
Database: Deepthroat
You can show it normally, OK.
? PHP
// Connect, select Database
$link = mysql_connect ( '' localhost '' , '' Root '' , '' 123 '' )
or die ( '' could not connect: '' . Mysql_error ());
Echo '' Connected successfully '' ;
mysql_select_db ( '' deepthroat '' ) or die ( '' could not select database '' );
// Execute SQL Query
$query = '' SELECT * from Dt_menu '' ;
$result = mysql_query ( $query ) or die ( '' Query failed: '' . Mysql_error ());
// display results in HTML
Echo " <table> " ;
while ( $line = Mysql_fetch_array ( $result , Mysql_assoc)) {
Echo " <tr> " ;
foreach ( $line as $col _value ) {
Echo " <td> $col _value</td> " ;
}
Echo " </tr> " ;
}
Echo " </table> " ;
// releasing the result set
Mysql_free_result ( $result );
// Close Connection
Mysql_close ( $link );
?>