Current location: Hot Scripts Forums » Programming Languages » PHP » First check the price, then check the title and see if contains..


First check the price, then check the title and see if contains..

Reply
  #1 (permalink)  
Old 01-04-07, 05:53 AM
Oskare100 Oskare100 is offline
Newbie Coder
 
Join Date: Apr 2005
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
First check the price, then check the title and see if contains..

Hello,
The answer I got when I asked this question a while ago was that any half decent query should do it but I forgoted the main problem, that it should both match the price and all of the identify_. Sorry to ask a similar question.

I want the script, when finnished, to be able to identify incomming orders by first checking the title and then, where price is = the price, check the identify to find a match.

Here is the database structure;
Code:
CREATE TABLE `items` (
  `item_id` int(11) NOT NULL auto_increment,
  `item_name` varchar(100) NOT NULL default ''
  `price` varchar(30) NOT NULL default '',
  `identify_pos` varchar(50) NOT NULL default '',
  `identify_pos2` varchar(50) NOT NULL default '',
  `identify_neg` varchar(50) NOT NULL default '',
  `identify_neg2` varchar(50) NOT NULL default '',
  `file_name` varchar(100) NOT NULL default '',
  `file_pack` varchar(30) NOT NULL default '',
  PRIMARY KEY  (`item_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
First the script needs to select all rows where "price" = $item_amount. Then it should check the $item_title and search all rows where the price is $amount and find a match where the $item_title contains "identify_pos" and "identify_pos2" but not "identify_neg" or "identify_neg2". To clarify, It is the title that should contain "identify_pos" and "identify_pos2" but not "identify_neg" or "identify_neg2" and the identify_ isn't the complete title, just keywords that the title should or shouldn't contain.

If the script finds one match, then continue. If the scripts finds several rows where the price = $item_amount and the title matches the identify_values then it should report it/do something else. Also, if it isn't a problem it would be good if the identify_ also can be empty so if just one identify_pos contains text then ignore the other identify_.

Thanks in advance,
/Oskar R
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 01-04-07, 04:53 PM
Oskare100 Oskare100 is offline
Newbie Coder
 
Join Date: Apr 2005
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Just wanted to add that the problem isn't solved... I still need all help I can get with it..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 08:58 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.