Rhino13 Posted September 10, 2013 Share Posted September 10, 2013 Good Day I was wondering if anyone could help me mysql does not seem to be working correctly MySQL server version: -- 5.5.24 the raw MySQL statement in question [mysql_query ("UPDATE ".$db_prefix."banner SET `shown`=0");] any errors that MySQL returns to the client [No ERROR just not updating] the table structure & column indexes of the relevant tables [---- Database: `second` -- -- -------------------------------------------------------- -- -- Table structure for table `shc_banner` -- CREATE TABLE IF NOT EXISTS `shc_banner` ( `idx` int(10) unsigned NOT NULL AUTO_INCREMENT, `banner_type` char(3) NOT NULL DEFAULT '', `cat_id` int(10) NOT NULL, `dir_id` char(3) NOT NULL, `banner_order` varchar(255) NOT NULL, `banner_file` varchar(255) NOT NULL DEFAULT '', `banner_title` varchar(255) NOT NULL DEFAULT '', `banner_url` varchar(255) NOT NULL DEFAULT '', `viewslimit` int(11) NOT NULL COMMENT 'After this amount of views has been reached, the ad will be expired. - 0 To disable', `clickslimit` int(11) NOT NULL COMMENT 'After this amount of clicks has been reached, the ad will be expired. - 0 to disable', `banner_target` varchar(255) NOT NULL, `banner_width` int(4) NOT NULL, `banner_height` int(4) NOT NULL, `banner_owner` varchar(255) NOT NULL DEFAULT '', `banner_dir` varchar(1000) NOT NULL, `banner_cat` varchar(1000) NOT NULL, `banner_hits` varchar(255) NOT NULL, `banner_clicks` varchar(255) NOT NULL, `show` int(1) DEFAULT NULL, PRIMARY KEY (`idx`), KEY `banner_type` (`banner_type`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Random Banner' AUTO_INCREMENT=170 ; -- -- Dumping data for table `shc_banner` --] the EXPLAIN output for your query: the query should update the database table but it does not in attached file line 64-67 a clear and concise description of what you want this statement to achieve: That the statment should update my table but it does not a description of what it's currently doing that's not to your liking: its not updating the table/ not even sowing up in debug mode localhost not live if anybody can help I'm new to this and could not find any solution at all Regards Rhino window.php Quote Link to comment https://forums.phpfreaks.com/topic/282038-mysql_query-not-updating/ Share on other sites More sharing options...
mikosiko Posted September 10, 2013 Share Posted September 10, 2013 `show` int(1) DEFAULT NULL, mysql_query ("UPDATE ".$db_prefix."banner SET `shown`=0");] if your code is not showing errors means that you are not controlling them properly Quote Link to comment https://forums.phpfreaks.com/topic/282038-mysql_query-not-updating/#findComment-1448967 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.