Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.