Need to match product with letters before the dash "-"

Reply

Join Date: Jan 2008
Posts: 16
Reputation: BillyMako is an unknown quantity at this point 
Solved Threads: 0
BillyMako BillyMako is offline Offline
Newbie Poster

Need to match product with letters before the dash "-"

 
0
  #1
Nov 6th, 2008
In the product list online i have the same products uner different names due to restrictions on oscommerce.

Example:
VDE004-DE
VDE004-DE1
VDE004-DE2
NLD6400-TO
NLD6400-TO1
etc.....

In the inventory list it will just have -
VDE004
NLD6400

When a product is purchased is decrements one off the stock_level column.

I need the code to say decrement 1 off the stock_level where the letters before a dash match the name in the inventory list.

So WHERE "VDE004"-DE = VDE004;

Can anyone help?
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 525
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro

Re: Need to match product with letters before the dash "-"

 
0
  #2
Nov 6th, 2008
  1. $fullProductId = explode("-", $value)
  2. $productId = $fullProductId[0]

Should work
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC