I have only been working with php and my sql for a short while, so my knowledge of it is still limited.
What I'm required to do is take a colour hex code from one field, break it into individual characters, convert it from a base 16 to a base 10 and update 6 additional columns with the new numbers.
the first part is easy:
- Code: Select all
$hexArray = str_split($formHEX);
$hex1 = base_convert($hexArray[0], 16, 10);
$hex2 = base_convert($hexArray[1], 16, 10);
$hex3 = base_convert($hexArray[2], 16, 10);
$hex4 = base_convert($hexArray[3], 16, 10);
$hex5 = base_convert($hexArray[4], 16, 10);
$hex6 = base_convert($hexArray[5], 16, 10);
its the dynamically updating every row base on it's initial value is the hard part.
ideas anyone?

