| | |
Need to match product with letters before the dash "-"
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2008
Posts: 16
Reputation:
Solved Threads: 0
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?
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?
php Syntax (Toggle Plain Text)
$fullProductId = explode("-", $value) $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.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
![]() |
Other Threads in the PHP Forum
- Previous Thread: converting array from mysql database into a different mysql table
- Next Thread: Need to read the most recently created XML file!
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess 301 access ajax apache api array beginner binary broken cakephp checkbox class cms code compression cron curl database date directory display download dropdown dynamic echo email error file files folder form forms function functions google href htaccess html httppost image include insert integration ip java javascript joomla limit link login loop mail md5 menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search secure select server sessions sms soap source space speed sql structure syntax system table tutorial update upload url validation validator variable video votedown web xml youtube





