RSS Forums RSS
Please support our MySQL advertiser: Programming Forums
Views: 4035 | Replies: 24 | Solved | Thread Tools  Display Modes
Reply
Join Date: Aug 2007
Posts: 25
Reputation: hemgoyal_1990 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
hemgoyal_1990 hemgoyal_1990 is offline Offline
Light Poster

Re: I am New In MySQL. Problem With MySQL Database Plz Help.

  #11  
Oct 18th, 2007
Originally Posted by trudge View Post
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.
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation: trudge is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: I am New In MySQL. Problem With MySQL Database Plz Help.

  #12  
Oct 18th, 2007
Originally Posted by hemgoyal_1990 View Post
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!"
Reply With Quote  
Join Date: Aug 2007
Posts: 25
Reputation: hemgoyal_1990 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
hemgoyal_1990 hemgoyal_1990 is offline Offline
Light Poster

Re: I am New In MySQL. Problem With MySQL Database Plz Help.

  #13  
Oct 18th, 2007
Originally Posted by trudge View Post
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"> &nbsp;<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."
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation: trudge is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: I am New In MySQL. Problem With MySQL Database Plz Help.

  #14  
Oct 18th, 2007
Originally Posted by hemgoyal_1990 View Post
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!"
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation: trudge is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: I am New In MySQL. Problem With MySQL Database Plz Help.

  #15  
Oct 19th, 2007
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.
Last edited by trudge : Oct 19th, 2007 at 2:36 am.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
Reply With Quote  
Join Date: Aug 2007
Posts: 25
Reputation: hemgoyal_1990 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
hemgoyal_1990 hemgoyal_1990 is offline Offline
Light Poster

Re: I am New In MySQL. Problem With MySQL Database Plz Help.

  #16  
Oct 19th, 2007
Originally Posted by trudge View Post
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.
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation: trudge is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: I am New In MySQL. Problem With MySQL Database Plz Help.

  #17  
Oct 19th, 2007
Originally Posted by hemgoyal_1990 View Post
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.



'CREATE TABLE details'
That is not legal MySQL code.
Amer Neely - Web Mechanic
"Others make web sites. We make web sites work!"
Reply With Quote  
Join Date: Aug 2007
Posts: 25
Reputation: hemgoyal_1990 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
hemgoyal_1990 hemgoyal_1990 is offline Offline
Light Poster

Re: I am New In MySQL. Problem With MySQL Database Plz Help.

  #18  
Oct 19th, 2007
Originally Posted by trudge View Post
'CREATE TABLE details'
That is not legal MySQL code.


CREATE TABLE details
(
id int(20),
name varchar(25),
telephone int(30),
birthday datetime
);

This is Full Sentex/Command.
Reply With Quote  
Join Date: Sep 2007
Location: North Bay Ontario
Posts: 176
Reputation: trudge is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 20
trudge trudge is offline Offline
Junior Poster

Re: I am New In MySQL. Problem With MySQL Database Plz Help.

  #19  
Oct 19th, 2007
Originally Posted by hemgoyal_1990 View Post
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!"
Reply With Quote  
Join Date: Aug 2007
Posts: 25
Reputation: hemgoyal_1990 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
hemgoyal_1990 hemgoyal_1990 is offline Offline
Light Poster

Re: I am New In MySQL. Problem With MySQL Database Plz Help.

  #20  
Oct 19th, 2007
Originally Posted by trudge View Post
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:35 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC