Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Thu Nov 11, 2004 8:06 am Reply with quote

Okay the below is is the table...

Code:


CREATE TABLE `hits` (
  `id` int(11) NOT NULL default '0',
  `titel` varchar(250) NOT NULL default '',
  `artiest` varchar(250) NOT NULL default '',
  `label` varchar(150) NOT NULL default '',
  `hp` smallint(6) NOT NULL default '0',
  `aw` smallint(6) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM;



And its a litle script to ad an artist ,song,and a cd or whatever the song is on...
So only using....titel,artist, and label


Problem now is,is that i need a search form....that searches the database and returns every result.

So if i entered Let's Dance - David Bowie cd5
and i search for david.... i want every result...with david...in artist name.

Anyone with knowledge who can figure this out....?
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Thu Nov 11, 2004 9:07 am Reply with quote

Select * from hits where artiest like '%david%';
 
View user's profile Send private message
hitwalker







PostPosted: Thu Nov 11, 2004 9:16 am Reply with quote

well thanks raven but that doesnt help....
i need a complete search for that has a search for artist and songtitle.
and then display results....
 
Raven







PostPosted: Thu Nov 11, 2004 9:23 am Reply with quote

Well that's not what you asked for Smile
Quote:
i want every result...with david...in artist name


Select * from hits where artiest like '%david%' OR title1 like '%david%';
 
hitwalker







PostPosted: Thu Nov 11, 2004 9:27 am Reply with quote

yeah i know but i thought that wasnt needed with all smarties here...

so to be clear.....
i need a search form that allowes me search on the artist name or song title
 
Raven







PostPosted: Thu Nov 11, 2004 9:33 am Reply with quote

It's in my last post.
 
hitwalker







PostPosted: Thu Nov 11, 2004 9:35 am Reply with quote

yeah but this is habracadabra to me raven.
so im still stuck...
 
hitwalker







PostPosted: Thu Nov 11, 2004 9:38 am Reply with quote

this is how the search form looks like...

Code:


<TABLE BORDER = 0 CELLPADDING = 0 CELLSPACING = 0>
   <FORM action="search.php" method=post target=main NAME="search">
   <TR>
   <TD width=75 align=right valign=bottom><span class="top-tekst">
   
   <IMG src="img/top_search_artiest.gif" border=0><BR>
   </TD>
   <TD width=100 valign=bottom>
   <INPUT type=text name=artiest size=27 class="zoeken"><BR>
   </TD>
   <TD width=55 align=right valign=bottom><span class="top-tekst">
   <IMG src="img/top_search_titel.gif" border=0><BR>
   </TD>
   <TD width=55 valign=bottom>
   <INPUT type=text name=titel size=27 class="zoeken"><BR>
   </TD>
   <TD width=55 valign=bottom>
   <INPUT TYPE=image src="img/top_search_zoek.gif" Value=submit><BR>
   </TD>
   <TD>


only i cannot use the search php anymore so that mysql part has to be build ....
 
hitwalker







PostPosted: Thu Nov 11, 2004 11:14 am Reply with quote

Nobody ?
 
hitwalker







PostPosted: Thu Nov 11, 2004 11:34 am Reply with quote

okay so not everything can be solved here huh....
 
blith
Client



Joined: Jul 18, 2003
Posts: 977

PostPosted: Thu Nov 11, 2004 11:45 am Reply with quote

patience... It is good to have here as well as in any tech help situation. Smile
 
View user's profile Send private message Visit poster's website
hitwalker







PostPosted: Thu Nov 11, 2004 1:15 pm Reply with quote

well the things i have done to solve this myself ....
everytime i think i found a answer/example pieces are missing.
and for the coders here its a piece of cake...
he...he...patience....?
 
hitwalker







PostPosted: Thu Nov 11, 2004 2:18 pm Reply with quote

well update.....
ive got it working now....
some things need to be changed and finaly it worked....but now i have a big pain in head...
 
Raven







PostPosted: Thu Nov 11, 2004 4:31 pm Reply with quote

Smile - Seriously, I felt that you had enough info to get it working and I took a chance on letting you try a while before offering anymore assistance Wink
 
hitwalker







PostPosted: Thu Nov 11, 2004 4:34 pm Reply with quote

yeah even the wall have a headache..
but this question is also for you raven......and willing to pay some for it....or who ever is first......

i have many lists like this....

Get Down Saturdaynight - Oliver Cheatham
Billie Jean - Michael Jackson
Valley Style - T. Sky Valley
Let The Music Play - Shannon
On The Upside - Xena

is it possible to make a script to import it into the database...?
 
Raven







PostPosted: Thu Nov 11, 2004 4:53 pm Reply with quote

Create a text file with all columns filled in, separated by a ,. For safety, enclose all values in " ". Since field1 is an autoincrement, in your text file use NULL (no quotes) as the value. Then, use this syntax to load it:

LOAD DATA INFILE '/tmp/filename.csv' INTO TABLE [table name] FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1,field2,field3,field4,field5,field6);
 
hitwalker







PostPosted: Thu Nov 11, 2004 4:55 pm Reply with quote

any help in the creation cause i dont have a clue what this means raven .... Sad
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©