It says "Query is messed up! So yure in trouble" And that query STILL doesn't work.
The whole page is:
<?
session_start();
?>
<?php
$link = mysql_connect("localhost", "zingbats", "My PWL")
or die("Could not connect");
mysql_select_db("tycooneden_com") or die("Could not select database");
$query = "UPDATE phpbb_users SET user_points = userpoints - 1 WHERE username = '".$_SESSION[username]."'";
$result = mysql_query($query) or die("Query is messed up! So yure buggered");
$foo=mysql_fetch_array($result);
mysql_close($link);
?>
<?
include "common.h";
if ($redirect != "") {
header("Location: " . $redirect);
exit;
}
// Connect to database and add 1 to download count
$con = mysql_connect($DB_SERVER, $DB_USER, $DB_PASS);
if (!$con) {
echo mysql_error();
exit;
}
if (!mysql_select_db($DB_NAME)) {
echo mysql_error();
mysql_close($con);
exit;
}
$rst = mysql_query("UPDATE Downloads SET DownloadCount = DownloadCount + 1 WHERE DownloadID = " . $DownloadID, $con);
if (!$rst) {
echo mysql_error();
mysql_close($con);
exit;
}
mysql_close($con);
// Send the file
header("Location: " . $Product );
?>