php使用insert语句添加到数据库

I have a simple insert statement that should use $GLOBALS that has my connection string in. Problem is that it does not insert the data. Have I done this correctly?

Insert.php

<?php
require 'core/init.php';

$Name = $_REQUEST["Name"];
$Venue = $_REQUEST["Venue"];
$Category = $_REQUEST["Category"];

$query = "INSERT INTO bands (Name, Venue, Category)
          VALUES ('$Name', '$Venue', '$Category')";
mysql_query ($query,$GLOBALS)
    or die ("could not add to database");

echo("You have added: <br />");
$result = mysql_query("SELECT * FROM bands ORDER  BY  Band_id DESC LIMIT 1");

while($row = mysql_fetch_array($result))
{
    echo $row['Name']. "" . $row['Venue']. "" . $row['Category'];
    echo "<br />";
}
?>

You don't put whole $GLOBALS variable in your mysql_query() call. You put the specific variable with the connection string only:

mysql_query($query, $GLOBALS['connection']) // Assuming you called the connection var "connection"
    or die ("could not add to database");

You need to connect mysql with mysql_connect() function then select database with mysql_select_db() function then you can call mysql_query function

you just cant execute queries with query string parameter you need to execute that connection query first and then select your database

And i suggest you to use mysqli instead of mysql cuz mysql methods will be deprecated soon