Why do you have to write it in a roundabout way using constants? Isn't it better to write DSN directly?
꯭人꯭生꯭就꯭像꯭过꯭山꯭车꯭
꯭人꯭生꯭就꯭像꯭过꯭山꯭车꯭ 2019-12-18 02:05:29
0
1
989

Like the question, thank the teacher for the answer

꯭人꯭生꯭就꯭像꯭过꯭山꯭车꯭
꯭人꯭生꯭就꯭像꯭过꯭山꯭车꯭

reply all(1)
ringa_lee

First of all, constants are super-global and do not need to be defined in multiple places, which reduces development costs

Secondly, the main function of constants can avoid repeated definitions and tampering with their values. When team development or when the amount of code is large, when defining some data that you do not want to change. If you use global variables, if you accidentally use the same variable name in subsequent code, the previous variable value will be replaced, and the code running result will not be what we expect

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template