Straight to the point...:)
I have problem connect to database. when I click Login button, the code can't read the username in my database.
I have checked the codes but i think there are some mistakes, but i don't know where it will be. Please help me. Here with I attach my login form and connection form...
Please help me soon. Thanks...

Recommended Answers

All 2 Replies

original koneksi.php

$connected = mysql_connect('localhost', 'root');
if( !connected ) {
die ("Connect to MySQL Server failed");
}

$retval = mysql_select_db("sarana", $connected);

if (!retval) {
die ("Database doesn't connect");
}

A couple changes are needed in your koneksi.php:

$connected = mysql_connect('localhost', 'root', 'password');
if( !$connected ) {
	die ("Connect to MySQL Server failed");
		 }

$retval = mysql_select_db("sarana", $connected);

if (!$retval) {
	die ("Database doesn't connect");
	     }

Thanks a lot for yor kind reply. I am satisfied. Once again, thank you...:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.