我有一个包含列的表的数据库,...player1
player2
player3
player12
我需要检查某行中的列player1
是否为空。
这是我在join.php中的内容:
<?php
require 'connect.inc.php';
$playername = $_GET['name'];
$tour_name = $_GET['tourname'];
if (isset($playername)&&
isset($tour_name)) {
$query = "SELECT `tour_name` FROM `tournies` WHERE `tour_name` = '$tour_name'";
$query_run = mysql_query($query);
echo mysql_error();
//mysql_query("UPDATE `tournies` SET player1='".$playername."' WHERE tour_name='".$tour_name."'");
if ($query_run = mysql_query($query)) {
header('Location: s.php');
} else {
echo 'not a win.';
echo mysql_error();
}
} else {
echo 'Invalid username or tournament ID, please return to <a href="index.php">Home</a> and try again. Sorry.';
}
?>