I don't know why I couldn't get the right output when I call following pages. When I run /mysql/bin/winmysqladmin.exe, I could see the green lights on the system try.
This is my.ini
#This File was made using the WinMySQLAdmin 1.4 Tool
#11/27/2003 1:20:16 AM
#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions
[mysqld]
basedir=E:/mysql
#bind-address=********
datadir=E:/mysql/data
#language=E:/mysql/share/your language directory
#slow query log#=
#tmpdir#=
#port=3306
#set-variable=key_buffer=16M
[WinMySQLadmin]
Server=E:/mysql/bin/mysqld-nt.exe
user=*******
password=*****
Here is the program I tested.
- Code: Select all
<?php
mysql_connect("localhost","****","****") or die("Uh Oh, Could not connect");
$Version = mysql_get_server_info();
$HostInfo = mysql_get_host_info();
print "My current MySQL version is: $Version
On $HostInfo";
?>
and here is the output i got
Warning: mysql_connect(): Access denied for user: 'shin0135@localhost' (Using password: YES) in E:\Apache Group\Apache2\htdocs\TestSQL.php on line 2
Uh Oh, Could not connect
When I tested another file like the following,
- Code: Select all
<h3> Press RELOAD to add a record to the MySQL database:</h3>
<?
//establish user connection
mysql_connect("localhost");
//open up database
mysql_create_db("testdatabase");
mysql_select_db("testdatabase");
//create table
mysql_query("CREATE TABLE newone(firstName VARCHAR(25),lastName VARCHAR(25))");
mysql_query ("INSERT INTO newone (firstName, lastName) VALUES ('Amir', 'Khan')");
//display the information
$result = mysql_query ("SELECT * FROM newone");
while($row = mysql_fetch_array($result))
{
print ("Added record: " . $row["firstName"]." ".$row["lastName"]." <br>\n");
}
//close user connection
mysql_close();
?>
I got another error message like the following,
Press RELOAD to add a record to the MySQL database:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\Apache Group\Apache2\htdocs\testmysql.php on line 13
I don't know what's going on.
Can anybody help me?
Thanks,



