When reading the card, depending on the amount of time to hold the card near the RFID antenna, read the information on the card several times.
Why do you think you'd get different answers?
My question is, how do I read only once the information, no matter how long the card is near the RFID antenna?
Most RFID readers do that for you.
You posted no code, although the rules for posting in this section REQUIRE you to. You posted no link to the hardware you are using. One can be forgiven for thinking that you don't really want help.
Why does setting the mode of the pins depend on connecting to the database server?
You still need to post a link to the RFID you are using, and clarify your initial post. Does the device keep making data available while the card is held near the antenna, or not?
A link to the RFID library you are using would be good, too.
Second:
The setting of the pin mode in this case depends on the connection of the Database because it loads data from the database and moves them to variables in the Arduino.
If you do not connect to the database, you can not continue the process. (this part I have not programmed)
Third:
"You still need to post a link to the RFID you are using" I do not understand this part.
"Does the device keep making data available while the card is held near the antenna, or not?"
Yes. When finish the process, it continue again.