Originally Posted by
hemgoyal_1990
1) I am Created this Database on My Home PC. not on Web or FTP. I dont Know how to Create Database on Web directly.
2) I am Using Code For Searchin not Creating Database. Code is Showen Below :-
[snip]
$hostname = "localhost"; // The Thinkhost DB server.
$username = "kuchcity"; // The username you created for this database.
$password = ""; // The password you created for the username.
$usertable = "details"; // The name of the table you made.
$dbName = "example"; // This is the name of the database you made.
MYSQL_CONNECT($hostname, $username, $password) OR DIE("DB connection unavailable");
@mysql_select_db( "$dbName") or die( "Unable to select database");
//error message (not found message)begins
$XX = "No Record Found, to search again please try again";
The Above Code is Show error Msg "Unable to Select Database."
You don't need to include your whole script when posting, just the relevant parts that illustrate where you are having a problem.
So we have established something:
1) you say this database is created on your home computer.
Please tell me how you created this database and the table 'details'.
2) if the database exists, show me how you access it from the command line using the parameters you are using with PHP (username, password, database name, and table). If you can't access it this way there is no point in trying to access it with PHP or any other technology.
3) since you are trying to use PHP to access your database, what web server have you installed that lets you do this? Even on your home computer, you must have a working web server installed before you can access a database this way.
Again, my suggestion to you is to do a LOT of research and learning on your own first. I've already suggested a few starting points (your school, library, the web, a good book).