Защо не добавя +1 в полето click ?

sianbg_s

Registered
Ето това ми е кода
Код:
<?
include ('inc/header.php');
echo '<div id="main">';
$id = $_GET['id'];
if ($id)
{
$sql = mysql_query("SELECT * FROM games WHERE id=$id") or die (mysql_error());
$row = mysql_fetch_assoc($sql);
$click = $row['click'] + 1;
$sql2 = "UPDATE games SET click='$click' WHERE id='.$id.'";
echo '
<b><h2><font color="red">'.$row['name'].'</font></h2></b>
<object
                        height="400" width="550"
                        codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
                        classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">

                        <param value="'.$row['link'].'" name="movie" />
                        <param value="high" name="quality" />
                        <param name="wmode" value="transparent" />
                        <embed
                            height="400" width="550"
                            type="application/x-shockwave-flash"
                            pluginspage="http://www.macromedia.com/go/getflashplayer"
                            quality="high"
                            wmode="transparent"
                            src="'.$row['link'].'">
                        </embed>
                    </object><br />
					<p class="upravlenie">Управление: '.$row['keys'].'					
';
mysql_query($sql2) or die (mysql_error());
}
echo '</div>';
include ('inc/footer.php');

?>
 
Код:
<? 
include ('inc/header.php'); 
echo '<div id="main">'; 
$id = $_GET['id']; 
if ($id) 
{ 
$sql = mysql_query("SELECT * FROM games WHERE id=$id") or die (mysql_error()); 
$row = mysql_fetch_assoc($sql); 
$sql2 = "UPDATE games SET click=click+1 WHERE id='.$id.'"; 
echo ' 
<b><h2><font color="red">'.$row['name'].'</font></h2></b> 
<object 
                        height="400" width="550" 
                        codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" 
                        classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> 

                        <param value="'.$row['link'].'" name="movie" /> 
                        <param value="high" name="quality" /> 
                        <param name="wmode" value="transparent" /> 
                        <embed 
                            height="400" width="550" 
                            type="application/x-shockwave-flash" 
                            pluginspage="http://www.macromedia.com/go/getflashplayer" 
                            quality="high" 
                            wmode="transparent" 
                            src="'.$row['link'].'"> 
                        </embed> 
                    </object><br /> 
               <p class="upravlenie">Управление: '.$row['keys'].'                
'; 
mysql_query($sql2) or die (mysql_error()); 
} 
echo '</div>'; 
include ('inc/footer.php'); 

?>

Така?
 
Код:
<?
include ('inc/header.php');
echo '<div id="main">';
$id = $_GET['id'];
if ($id)
{
$sql = mysql_query("SELECT * FROM games WHERE id=$id") or die (mysql_error());
$row = mysql_fetch_assoc($sql);
$click = $row['click'];
$sql2 = "UPDATE games SET click='$click+1' WHERE id='.$id.'";
echo '
<b><h2><font color="red">'.$row['name'].'</font></h2></b>
<object
                        height="400" width="550"
                        codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
                        classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">

                        <param value="'.$row['link'].'" name="movie" />
                        <param value="high" name="quality" />
                        <param name="wmode" value="transparent" />
                        <embed
                            height="400" width="550"
                            type="application/x-shockwave-flash"
                            pluginspage="http://www.macromedia.com/go/getflashplayer"
                            quality="high"
                            wmode="transparent"
                            src="'.$row['link'].'">
                        </embed>
                    </object><br />
               <p class="upravlenie">Управление: '.$row['keys'].'
';
mysql_query($sql2) or die (mysql_error());
}
echo '</div>';
include ('inc/footer.php');

?>
Я пробвай така :)
 
@Zion не става. Аз сам се оправих. Объркал съм заявката. Ето така трябвало да е
Код:
$sql2 = "UPDATE games SET click='$click' WHERE id='$id'";
 
sianbg_s каза:
@Zion не става. Аз сам се оправих. Объркал съм заявката. Ето така трябвало да е
Код:
$sql2 = "UPDATE games SET click='$click' WHERE id='$id'";
Ами да променливата трябва да е в ' '
 

Горе