I don't think the problem is with DNS or reaching the server.
I ran Microsoft Network Monitor on the SQL Server machine.
When I successfully connect using ComputerA.example.com, I see this:
SMB:C; Tree Connect Andx, Path = \ComputerA.example.com\IPC$, Service = ?????
When I successfully connect using the IP address, I see this:
SMB:C; Tree Connect Andx, Path = \172.31.250.6\IPC$, Service = ?????
When I try to connect using sql_server.example.com, I see this:
SMB:C; Tree Connect Andx, Path = \sql_server.example.com\IPC$, Service = ?????
So the connection is getting through from the PHP machine to the SQL machine. SQL Server just seems to be rejecting the connection when Path = \sql_server.example.com for some reason.
It is as if SQL Server does not recognize "sql_server" as belonging to the host computer.
"ComputerA" is registered on the computer as being its machine name.
172.31.250.6 is registered on the network card configuration.
But "sql_server" is only in the DNS server configuration (as an A record); there is no record of "sql_server" in the configuration of the SQL Server computer.