two hypotheses
A
$do->query(
"INSERT INTO `abc` (
`public_order_id`,
`add_time`,
`status`
)
VALUES (
"{$public_order_id}",
"{$add_time}",
""
) "
);
B
$do->query(
"INSERT INTO `abc` (
`public_order_id`,
`add_time`,
`status`
)
VALUES (
"{$public_order_id}",
"{$add_time}",
""
) "
);
suppose there are more than two places that my action will use
, but the only thing that will change is status
An is "cancelled"
B will change to "completed"
to other places there will be another status
everything else is the same,
then how does a mysql query like this come up?
originally intended to put it in function, but it won"t work.
think of a question
if you want to let function use the external value
I can use global to let the external value come in function
but what if he doesn"t look like $abc but like $SESSION ["id"] and $oder [" id"]?
$abc = 1;
function XXX () {
global $abc;
echo $abc; / / can show
}