我试图在我的 pom.xml 中包含 GSON,但 IntelliJ 告诉我没有找到依赖项“com.google.code.gson:gson:2.8.0”。我曾尝试调用 Maven 存储库,但它仍然无法正常工作。还要忽略注释掉的行。
这是我的 pom 文件的副本。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>TagChooser</groupId>
<artifactId>TagChooser 1.7.10</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!-- Gson: Java to Json conversion -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
<scope>compile</scope>
</dependency>
<!--<dependency>-->
<!--<groupId>mkremins</groupId>-->
<!--<artifactId>fanciful</artifactId>-->
<!--<version>0.4.0-SNAPSHOT</version>-->
<!--</dependency>-->
</dependencies>
<repositories>
<repository>
<id>central</id>
<name>Maven repository</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
<!--<repository>-->
<!--<id>stealthyone-repo</id>-->
<!--<url>http://repo.stealthyone.com/content/groups/public</url>-->
<!--</repository>-->
</repositories>
Run Code Online (Sandbox Code Playgroud)
我试图显示表中的所有信息,但当我查询信息然后将其放入PHP表时,它不显示最后一个表中的任何数据.

这是我的表的PHP代码
<table border='1'>
<tr>
<th>Ticket ID</th>
<th>Username</th>
<th>Message</th>
<th>Date</th>
<th>Error #</th>
<th>Priority</th>
</tr>
<?php
if(!$query){
die('Invalid query: ' .mysql_error());
}
while ($row = mysql_fetch_array($query)) { ?>
<tr>
<td><?php echo $row['TicketID']; ?></td>
<td><?php echo $row['Message']; ?></td>
<td><?php echo $row['Date']; ?></td>
<td><?php echo $row['Error']; ?></td>
<td><?php echo $row['Priority']; ?></td>
</tr>
<?php } ?>
</table>
Run Code Online (Sandbox Code Playgroud)
这是用于查询的PHP代码
<?php
$server = mysql_connect("localhost", "root", "**password**");
$db = mysql_select_db("minecraft", $server);
$query = mysql_query("SELECT * FROM tickets");
?>
Run Code Online (Sandbox Code Playgroud)
我的所有行名都是正确的,但它不想将数据放入该列.