•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 427,187 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,199 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 3503 | Replies: 24 | Solved
![]() |
•
•
Join Date: Aug 2007
Posts: 25
Reputation:
Rep Power: 2
Solved Threads: 0
•
•
•
•
Then you must find out from your host whether MySQL is installed, and whether you have access to it. Then using either phpMyAdmin or Heidi or some other client program, create your database and tables etc.
To find out more about MySQL go to mysql.com or find yourself a good book. You cannot learn enough about it from a few forum postings.
If you own your own server and are maintaining it for public access then you have quite a lot on your plate to learn.
So first answer whether your web domain is hosted by another company or by yourself.
Either way you will have to take some time and learn about relational databases in general and MySQL in particular on your own.
You will also need a programming language to access the web-based database such as Perl or PHP or Java or Python, etc.
Your ftp server has nothing to do with MySQL or this thread.
First ) My Web Domain is Hosted by www.techplanethosting.com . This is my Brother companey.
Second ) i am Using PHP for Accessing my Database But When i Create Datanase and Load it to my FTP server & Using PHP for Accessing Database PHP show Database not Found.
What Can i Do.
•
•
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation:
Rep Power: 2
Solved Threads: 20
•
•
•
•
First ) My Web Domain is Hosted by www.techplanethosting.com . This is my Brother companey.
Second ) i am Using PHP for Accessing my Database But When i Create Datanase and Load it to my FTP server & Using PHP for Accessing Database PHP show Database not Found.
What Can i Do.
Where are you creating your database? On your hosted web site or on your home computer?
Show me the PHP code you are using to create a database and access it.
Why do you keep talking about your ftp server? IT HAS NOTHING TO DO WITH THIS.
I believe you need to educate yourself a bit more on the concept of a web-based database. There seems to be some confusion in your mind on how things work. Do some research using your favourite search engine, or visit your library or school for some good material. I am not prepared to do this for you.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
"Others make web sites. We make web sites work!"
•
•
Join Date: Aug 2007
Posts: 25
Reputation:
Rep Power: 2
Solved Threads: 0
•
•
•
•
Where are you creating your database? On your hosted web site or on your home computer?
Show me the PHP code you are using to create a database and access it.
Why do you keep talking about your ftp server? IT HAS NOTHING TO DO WITH THIS.
I believe you need to educate yourself a bit more on the concept of a web-based database. There seems to be some confusion in your mind on how things work. Do some research using your favourite search engine, or visit your library or school for some good material. I am not prepared to do this for you.
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 :-
<HTML>
<BODY>
<FORM Action="/SearchInSide.php" Method="POST">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td bordercolor="#000000">
<p align="center">
<select name="metode" size="1">
<option value="name">Name</option>
<option value="telephone">Telephone</option>
<option value="birthday">Birthday</option>
</select> <input type="text" name="search" size="25"> <br>
Search database: <input type="submit" value="Go!!" name="Go"></p>
</td>
</tr>
</table>
</div>
</form>
<center>
<table border="1" cellpadding="5" cellspacing="0" bordercolor="#000000">
<tr>
<td width="60"><b>ID</b></td>
<td width="100"><b>Name</b></td>
<td width="70"><b>Telephone</b></td>
<td width="150"><b>Birthday</b></td>
</tr>
<?php
if ($_POST['Go'])//user clicks go..
{
$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");
?>
<?php
//error message (not found message)begins
$XX = "No Record Found, to search again please try again";
//query details table begins
$query = mysql_query("SELECT * FROM details WHERE '$_POST[metode]' LIKE '$_POST[search]'% LIMIT 0, 50");
while ($row = @mysql_fetch_array($query))
{
$variable1=$row["id"];
$variable2=$row["name"];
$variable3=$row["telephone"];
$variable4=$row["birthday"];
//table layout for results
print ("<tr>");
print ("<td>$variable1</td>");
print ("<td>$variable2</td>");
print ("<td>$variable3</td>");
print ("<td>$variable4</td>");
print ("</tr>");
}
//below this is the function for no record!!
if (!$variable1)
{
print ("$XX");
}
//end
}
?>
</table>
</center>
</BODY>
</HTML>
The Above Code is Show error Msg "Unable to Select Database."
•
•
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation:
Rep Power: 2
Solved Threads: 20
•
•
•
•
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).
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
"Others make web sites. We make web sites work!"
•
•
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation:
Rep Power: 2
Solved Threads: 20
In thinking about your situation a question arose: why do think you need to use MySQL for your purpose? Do you know what a relational database is?
According to your posted code, you are only tracking 4 pieces of data: name, phone number and birthday (plus an added ID field, which I don't see the purpose of).
So what could be simpler than a plain text file formatted as CSV or whatever?
For example:
id1|my name|yyyymmdd|nnnnnnnnnn
id2|your name|yyyymmdd|nnnnnnnnnn
id3|his name|yyyymmdd|nnnnnnnnnn
id4|her name|yyyymmdd|nnnnnnnnnn
You can use PHP's native string / regex functions to find whatever you want.
Using a relational database for such a simple task is like using a sledge hammer to put in a 1" finishing nail.
According to your posted code, you are only tracking 4 pieces of data: name, phone number and birthday (plus an added ID field, which I don't see the purpose of).
So what could be simpler than a plain text file formatted as CSV or whatever?
For example:
id1|my name|yyyymmdd|nnnnnnnnnn
id2|your name|yyyymmdd|nnnnnnnnnn
id3|his name|yyyymmdd|nnnnnnnnnn
id4|her name|yyyymmdd|nnnnnnnnnn
You can use PHP's native string / regex functions to find whatever you want.
Using a relational database for such a simple task is like using a sledge hammer to put in a 1" finishing nail.
Last edited by trudge : Oct 19th, 2007 at 1:36 am.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
"Others make web sites. We make web sites work!"
•
•
Join Date: Aug 2007
Posts: 25
Reputation:
Rep Power: 2
Solved Threads: 0
•
•
•
•
In thinking about your situation a question arose: why do think you need to use MySQL for your purpose? Do you know what a relational database is?
According to your posted code, you are only tracking 4 pieces of data: name, phone number and birthday (plus an added ID field, which I don't see the purpose of).
So what could be simpler than a plain text file formatted as CSV or whatever?
For example:
id1|my name|yyyymmdd|nnnnnnnnnn
id2|your name|yyyymmdd|nnnnnnnnnn
id3|his name|yyyymmdd|nnnnnnnnnn
id4|her name|yyyymmdd|nnnnnnnnnn
You can use PHP's native string / regex functions to find whatever you want.
Using a relational database for such a simple task is like using a sledge hammer to put in a 1" finishing nail.
Hi,
I am Using This Command for Creating Database "CREATE DATABASE example;"
and Table Creating Command "CREATE TABLE details;"
and I am Just Using MySQL 5.0 . and My Web Server is Linux.
•
•
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation:
Rep Power: 2
Solved Threads: 20
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
"Others make web sites. We make web sites work!"
•
•
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation:
Rep Power: 2
Solved Threads: 20
•
•
•
•
CREATE TABLE details
(
id int(20),
name varchar(25),
telephone int(30),
birthday datetime
);
This is Full Sentex/Command.
OK. So you have created the table. How are you accessing this database? Command line? Some other program?
Have you populated it?
And Linux is not your web server. Linux is your Operating System.
Have you considered my earlier post regarding using a simple text file for your needs? I think the approach you are taking is quite a bit beyond your capability right now.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
"Others make web sites. We make web sites work!"
•
•
Join Date: Aug 2007
Posts: 25
Reputation:
Rep Power: 2
Solved Threads: 0
•
•
•
•
OK. So you have created the table. How are you accessing this database? Command line? Some other program?
Have you populated it?
And Linux is not your web server. Linux is your Operating System.
Have you considered my earlier post regarding using a simple text file for your needs? I think the approach you are taking is quite a bit beyond your capability right now.
I am Accessing This Database on Command Line.
and My OS is Window XP SP2.
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- jsp and mysql (JSP)
- MySQL datatype problem.... (PHP)
- about VC+MySQL problem:) (C)
- php/mysql communication problem (PHP)
- php mysql problem (PHP)
- help pleaseee! probl with username and passwd when updating mysql database (MySQL)
- NEWS - MySQL Database To Get New Features (MySQL)
- mysql start up problem (MySQL)
Other Threads in the MySQL Forum
- Previous Thread: PHP/MySQL Help Needed
- Next Thread: Reading an external DB from my site


Linear Mode