hadiesyafiq 7 Posted October 26, 2019 (edited) i have script but i lost the SQL Table can someone teach me how to create new one for the script... here some query sql on the script query_sql( "SELECT `id` FROM `e_freebie` WHERE `aid` = "+.@aid+" LIMIT 1", .@id ); query_sql( "INSERT INTO `e_freebie` ( `aid` ) VALUES ( "+.@aid+" )" ); query_sql( "SELECT COUNT(`id`) FROM `e_freebie` WHERE `status` = 2",.@total_id ); query_sql( "SELECT `id`, `time` FROM `e_freebie` WHERE `status` = 1 AND `aid` = "+ .@aid, .@id, .@time$ ); query_sql( "UPDATE `e_freebie` SET `status` = 2, `time` = NOW() WHERE `id` = "+.@id+" LIMIT 1" ); Edited October 26, 2019 by hadiesyafiq Quote Share this post Link to post Share on other sites
0 Chatterboy 8 Posted October 27, 2019 10 hours ago, hadiesyafiq said: i have script but i lost the SQL Table can someone teach me how to create new one for the script... here some query sql on the script query_sql( "SELECT `id` FROM `e_freebie` WHERE `aid` = "+.@aid+" LIMIT 1", .@id ); query_sql( "INSERT INTO `e_freebie` ( `aid` ) VALUES ( "+.@aid+" )" ); query_sql( "SELECT COUNT(`id`) FROM `e_freebie` WHERE `status` = 2",.@total_id ); query_sql( "SELECT `id`, `time` FROM `e_freebie` WHERE `status` = 1 AND `aid` = "+ .@aid, .@id, .@time$ ); query_sql( "UPDATE `e_freebie` SET `status` = 2, `time` = NOW() WHERE `id` = "+.@id+" LIMIT 1" ); CREATE TABLE IF NOT EXISTS `e_freebie` ( `id` int(11) unsigned NOT NULL auto_increment, `aid` int(11) unsigned NOT NULL default '0', `status` int(11) unsigned NOT NULL default '0', `time` datetime NOT NULL, ) ENGINE=MyISAM; Quote Share this post Link to post Share on other sites
0 hadiesyafiq 7 Posted October 28, 2019 22 hours ago, Chatterboy said: CREATE TABLE IF NOT EXISTS `e_freebie` ( `id` int(11) unsigned NOT NULL auto_increment, `aid` int(11) unsigned NOT NULL default '0', `status` int(11) unsigned NOT NULL default '0', `time` datetime NOT NULL, ) ENGINE=MyISAM; Thank you very much sir Quote Share this post Link to post Share on other sites
0 Chatterboy 8 Posted October 28, 2019 no problem ^_^ Quote Share this post Link to post Share on other sites
i have script but i lost the SQL Table
can someone teach me how to create new one for the script...
here some query sql on the script
query_sql( "SELECT `id` FROM `e_freebie` WHERE `aid` = "+.@aid+" LIMIT 1", .@id );
query_sql( "INSERT INTO `e_freebie` ( `aid` ) VALUES ( "+.@aid+" )" );
query_sql( "SELECT COUNT(`id`) FROM `e_freebie` WHERE `status` = 2",.@total_id );
query_sql( "SELECT `id`, `time` FROM `e_freebie` WHERE `status` = 1 AND `aid` = "+ .@aid, .@id, .@time$ );
query_sql( "UPDATE `e_freebie` SET `status` = 2, `time` = NOW() WHERE `id` = "+.@id+" LIMIT 1" );
Edited by hadiesyafiqShare this post
Link to post
Share on other sites