Jump to content

[SOLVED] very strange problem with update statement


wolfrat

Recommended Posts

Hey everyone, am making a simple clicktracker sort of thing, and am running into trouble updating the system.

 

This is the statement I use (id is already sanitized, afila is the name of my table, and out is the column of 'click' values):

UPDATE afila SET out=out+1 WHERE id='$id'

 

However, when I try to execute that command, I get:

 

SQL query:

 

UPDATE afila SET out = out +1 WHERE id = '1'

 

MySQL said: Documentation

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out=out+1 WHERE id='1'' at line 1

 

and here is my table structure:

-- phpMyAdmin SQL Dump
-- version 2.10.0.2
-- http://www.phpmyadmin.net
-- 
-- Host: ************
-- Generation Time: Jan 02, 2008 at 10:43 PM
-- Server version: 5.0.41
-- PHP Version: 5.2.5

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

-- 
-- Database: `***data`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `afila`
-- 

CREATE TABLE `afila` (
  `id` int(3) NOT NULL auto_increment,
  `in` int(6) NOT NULL,
  `out` int(6) NOT NULL,
  `name` varchar(60) NOT NULL,
  `image` varchar(400) NOT NULL,
  `url` varchar(400) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

 

Any help would be much appreciated.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.