Okay, Say I have a table with three columns:
1) serial_number (which is the key index)
2) vendor_price
3) my_price
Now, the catch is vendor_price is a VARCHAR(50) because it contains data like this:
$1,942.49
With the dollar sign and the comma. What I need to do is pull every value out, then do something like this:
<?php
$string = trim($string, '$');
echo "\$string = $string";
echo "<br><br>";
$remove=",";
$replacewith='';
$newstring = str_replace($remove, $replacewith, $string);
echo $newstring; */
?>
To get left with 1942.49
Then multiply it by say 1.10 and stick it back in the right row as a DECIMAL(10,2) under the column my_price..
So.. pull it out, strip the cr@p, do some math stick it back in in the right place...
Any takers?
1) serial_number (which is the key index)
2) vendor_price
3) my_price
Now, the catch is vendor_price is a VARCHAR(50) because it contains data like this:
$1,942.49
With the dollar sign and the comma. What I need to do is pull every value out, then do something like this:
<?php
$string = trim($string, '$');
echo "\$string = $string";
echo "<br><br>";
$remove=",";
$replacewith='';
$newstring = str_replace($remove, $replacewith, $string);
echo $newstring; */
?>
To get left with 1942.49
Then multiply it by say 1.10 and stick it back in the right row as a DECIMAL(10,2) under the column my_price..
So.. pull it out, strip the cr@p, do some math stick it back in in the right place...
Any takers?