943,660 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 439
  • PHP RSS
Nov 6th, 2008
0

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

Expand Post »
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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
BillyMako is offline Offline
16 posts
since Jan 2008
Nov 6th, 2008
0

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

php Syntax (Toggle Plain Text)
  1. $fullProductId = explode("-", $value)
  2. $productId = $fullProductId[0]

Should work
Reputation Points: 96
Solved Threads: 124
Master Poster
Will Gresham is offline Offline
728 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: converting array from mysql database into a different mysql table
Next Thread in PHP Forum Timeline: Need to read the most recently created XML file!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC