Spinal cord injury (SCI) and ankylosing spondylitis (AS) are common inflammatory diseases in spine surgery. However, it is a project where the relationship between the two diseases is ambiguous and the efficiency of drug discovery is limited. Therefore, the study aimed to investigate new drug therapies for SCI and AS. First, text mining was used to obtain the interacting genes related to SCI and AS, and then, the functional analysis was conducted. Protein–protein interaction (PPI) networks were constructed by STRING online and Cytoscape software to identify hub genes. Last, hub genes and potential drugs were performed after undergoing drug–gene interaction analysis, and MicroRNA and transcription factors regulatory networks were also analyzed. Two hundred five genes common to “SCI” and “AS” identified by text mining were enriched in inflammatory responses. PPI network analysis showed that 30 genes constructed two significant modules. Ultimately, nine (SST, VWF, IL1B, IL6, CXCR4, VEGFA, SERPINE1, FN1, and PROS1) out of 30 genes could be targetable by a total of 13 drugs. In conclusion, the novel core genes contribute to a novel insight for latent functional mechanisms and present potential prognostic indicators and therapeutic targets in SCI and AS.