Jump to content

[SOLVED] possibly a bad sql statment?


blueman378

Recommended Posts

hi guys,

well heres the error,

Error: Unknown column 'boo' in 'where clause'

heres the code

function doSomething()
{
global $cat;
global $action;
global $database;
// delete script here
$q = ("DELETE FROM gsubcat WHERE cName = $cat")or die("Your have an error because:<br />" . mysql_error());
$result = $database->query($q) or die("Error: " . mysql_error());
    header("Location: Category manager.php?action=$action&cat=$cat&run=y");} 
}

 

heres the url

http://localhost/admin/catprocess.php?action=Delete&cat=boo

 

heres the table exported,

-- phpMyAdmin SQL Dump
-- version 2.11.2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 25, 2007 at 10:14 PM
-- Server version: 5.0.45
-- PHP Version: 5.2.5

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `game`
--

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

--
-- Table structure for table `gsubcat`
--

CREATE TABLE `gsubcat` (
  `cId` tinyint(3) unsigned NOT NULL auto_increment,
  `cName` varchar(50) NOT NULL,
  UNIQUE KEY `cId` (`cId`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;

--
-- Dumping data for table `gsubcat`
--

INSERT INTO `gsubcat` (`cId`, `cName`) VALUES
(1, 'Action / Adventure'),
(2, 'Beat em up'),
(3, 'Other'),
(4, 'Puzzle'),
(5, 'Racing'),
(6, 'Retro'),
(7, 'Shoot em up'),
(8, 'Sports'),
(20, 'boo');

 

any ideas?

 

oh and merry xmas to you too red arrow :)

 

btw the reason for so many questions is i am working on many parts of the site :)

Link to comment
https://forums.phpfreaks.com/topic/83127-solved-possibly-a-bad-sql-statment/
Share on other sites

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.