1
I include in a array
, user informed data. But, I use only one array
to store data from two fields, where I use "P"(And the entered data) for the first field and "S"(And the data entered) for the second field. Thus the data is out of order on array
. Example:
array_dados=[P01000213, P154878946, S797465464,P454464654,S48897874, ...]
So I’d like to store in table do banco
the information of array
.. But, "P" and "S" are different fields in table
and I only use the letters before the numbers to know which fields they will go to!
My doubt ... " How to remove these letters (P and S) and store the data in its proper fields in the table?"
Table I need to store the fields:
CREATE TABLE sai_info_dados
(
seq_info integer NOT NULL DEFAULT nextval('sam_cad_info'::regclass),
tx_num_prim character varying(12) NOT NULL,
tx_num_secu character varying(15) NOT NULL
)
Why don’t you make your job easier and create the multidimensional array? Sort of:
$array_dados = array(array('P' => '01000213', 'S' => ''),array('P' => '154878946', 'S' => '797465464'),array('P' => '454464654', 'S' => '48897874'));
thus you guarantee data parity.– Jader A. Wagner