Thanx Dude...

This is Nice Programme and Solve my All Trouble.

Hi All,
I got seem a problem with my php. How I Can View my PHP File on Offline Mode...

Plz Give me the Solution to View my PHP file on offline mode...

I Dont Have any website....

Sorry Frnd But Your Given Code Does Not Eork Plz Help me.....
Someone Plz Help Me...

Thanx frnd for Helping me but This Code does not work.... It;s Does Not Show Maney Data in a Hyperlink View.... Plz Give me Approx Code.

Hi All,
I Have Some Problem with my PHP Searching Code...
I Want to Create Hyperlink of Multipul Data for Ex. :- a user Found example if this query have maney data this show as hyperlink view....

i am using this code.......

[code]
<?php
/**

  • Main Search Page - search.php
  • Author: Your Name user@something.com
  • This file searches the database
    **/

//Get variables from config.php to connect to mysql server
$dbhost='localhost';
$dbusername='user';
$dbuserpass='password';
$dbname = 'dbname';

// connect to the mysql database server.
mysql_connect ($dbhost, $dbusername, $dbuserpass);
//select the database
mysql_select_db($dbname) or die('Cannot select database');

//search variable = data in search box or url
if(isset($_GET['search']))
{
$search = $_GET['search'];
}

//trim whitespace from variable
$search = trim($search);
$search = preg_replace('/\s+/', ' ', $search);

//seperate multiple keywords into array space delimited
$keywords = explode(" ", $search);

//Clean empty arrays so they don't get every row as result
$keywords = array_diff($keywords, array(""));

//Set the MySQL query
if ($search == NULL or $search == '%'){
} else {
for ($i=0; $i<count($keywords); $i++) {
$query = "SELECT * FROM table " .
"WHERE Roll_No LIKE '%".$keywords[$i]."%'".
" OR Name LIKE '%".$keywords[$i]."%'" .
" ORDER BY Roll_No";
}

//Store the results in a variable or die if query fails
$result = mysql_query($query) or die(mysql_error());
}
if ($search == NULL or $search == '%'){
} else {
//Count the rows retrived
$count = mysql_num_rows($result);
}

echo "<html>";
echo "<head>";
echo "<title>Your Title Here</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />";
echo "</head>";
echo "<body onLoad=\"self.focus();document.searchform.search.focus()\">"; ...

Dear i Want to Create a Search page so any one user can search data from this page. if u know right coading plz post here.

No Dear, in this script line
SELECT * FROM details WHERE '$_POST[metode]' LIKE '$_POST[search]'% LIMIT 0, 50 there metode is not not any coloumn this is a POST METHOD.

Dear i am Doing Your Tricx But my Problem doe's not solved yet.... Plz Dear Give me Solution of my problem.

Hi All, I Have a PHP Searching Code it have some problem it only connet to database but does not show any result..........

PHP Code is :-
Search.php
[code=php]<HTML>
<BODY>
<FORM Action="/Search.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..
{
$dbh=mysql_connect ("localhost", "kuchcity_hemant", "hemgoyal") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("kuchcity_example");
?>
<?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>[/code]

any one plz help me......

Thanx Dear for Suggesting me But i Have one Problem There in CSV File What is The Field Name. When I am Inserting any Field Name the phpMyAdmin Say Invalid field Name Specified..... What Can i Do Next..

Hi All,
I am a Problem with Database. I Don't Know How Can i Import my Data in MySQL Database Using CSV Format. Can anyone Plz Help me. I am Using phpMyAdmin for Accessing my Database...
Plz Help me.

Thanx Dude. For Help Me. I am Very Thankful for You.

Dude i only want help of you. i want to know how can i create search page usng MSAccess & PHP.

Hi Frends,
I am Working on a Database Project. I am New in PHP. I Want to Create a Search Page for My City Web Directory. How Can i Use MSAccess Database with PHP. Can Any one Give me Script for Accessing Database in PHP. I am Using Linux Hosting Server.

Plz Help me.

[QUOTE=trudge;454684]You have already said you have created this database and the table from the command line, now you are asking how to create it with PHP.

I have already said that to solve your immediate problem you might be better to use a simple text file to hold your data. There is no need to use MySQL.

[B]Why do you think you need MySQL? [/B]

[B]Why do you think you need PHP?[/B]

[B]Please answer ALL questions I ask you, not just the ones you want to.[/B]

You seem to be lacking some very fundamental knowledge of several areas of Internet technology.

Have you heard the expression 'Walk before you run'? This applies to you.

You need to educate yourself on some very basic concepts before you go fooling around with some code you found somewhere.

I will not be sending you any 'Complete Producer' as you have already indicated you have the database created.

Show me the result of 'show databases' and 'show tables' and 'describe details' from your command line using the mysql client program that comes with MySQL. This is easy to capture and paste into your reply.

Again, your end task of providing a phone number database might be better served using simple text files. At your level of knowledge and experience that is all I am prepared to load on your plate.[/QUOTE]

Q.1 ) I Need MySQL Creating Database, Tables only.

Q.2 ) and PHP Accessing it on Interne; I am Using PHP for Searching Database ...

[QUOTE=trudge;454021]Good, you can access it from the command line. What exactly is your problem / question then?

This is beginning to look like a PHP problem rather than a MySQL problem.[/QUOTE]

my Problem is I cannot Access my Database on PHP createde with PHP.
What Can u Send me Complete Processure for Creating Database in MySQL.
First to Last Step so I Can Create Database in MySQL & Use it.

U Can Send me This Complete Producer in Text File Attach With This.

Plz Help me. U R So Greate.

[QUOTE=trudge;453902]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.[/QUOTE]

I am Accessing This Database on Command Line.

and My OS is Window XP SP2.

[QUOTE=trudge;453897]'CREATE TABLE details'
That is not legal MySQL code.[/QUOTE]

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

This is Full Sentex/Command.

[QUOTE=trudge;453871]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.[/QUOTE]

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.

[QUOTE=trudge;453262]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.[/QUOTE]

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 ...

[QUOTE=trudge;452882]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.[/QUOTE]

First ) My Web Domain is Hosted by [url]www.techplanethosting.com[/url] . 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.

I am Using my Database for Public Access on Web. I am Developed a Site [url]www.kuchamancity.com[/url] . this is my Home town Website. & I am Provide Search Facility in This Website. my FTP Server is Linux. So I want to Create database in MySQL. Plz Suggest me.

it First i am Using MySQL 5.0 Downloading From [url]http://dev.mysql.com[/url] and I am Install this on My System. This run On DOS Screen. and When I Start This is Ask For Password. When I Enter Password. It's Redirect to me On mysql> Command Line Pompt and after this i am using CREATE DATABASE db_name; syntex for Creating Database. But When I Using This Syntex I am Successfully Created Database but This not Work on My FTP Server. This Syntex Only One File Create db.opt.

What Can u meet me on Chating in Yahoo. I am Online on my e-Mail:- [email]hemgoyal_1990@yahoo.co.in[/email] . I am Online Everyday 3.00 to 4.30 PM.

Plz Send me Better Sugession so I can Develope my City Telephone Number Searching Project.

Thank You.

Yes I am Found MySQL in Service under Adminstartion Tool & I Found it this Place. It's States are 'Started'. Plz Suggest me What Can I Do Next.

For example, what OS are you running this on?

WIN XP SP2.

Are you sure the MySQL server is running? How do you know?

I Don't Know. How I Can Check This.

Have you created a user besides 'root', and logged in as that user?

I Have already Create user 'root'. And i Dont Know How Can I Logged.

Can you connect to the MySQL from the command line?

I Dont Know How Can I Connect to MySQL from Command Line.

Have you read the documentation at www.mysql.com?

Yes. I am Read Document But dont Understand anything.

Hi All,
I am New in MySQL. I Want to Create a Database in MySQL. I am Using MySQL5.0 & Write This Sentex for Creating Database :- CREATE DATABASE db_name;
But When I Use This Sentex Create Database With Single db.opt File. & I run this Database on Server Message Desplaye "Database Not Found"
How Can I Do Create Database in MySQL to Run on My FTP Server. Plz Anyone Help Me.