я вставляя данные в базе данных, мой запрос отлично работает для первых четырех элементов, но после того, что он дал мне этот вопрос и мой кодПочему запрос не удалось вставить данные
//Specialdeals
-(void) insertDealsTipIntoSqlite:(NSString *)title andDetail:(NSString *)detail andStartdate:(NSString*)startDate andEnddate:(NSString*)endDate andImage:(NSString *)image andThumb:(NSString*)thumb andBranch:(NSString *)branch
{
NSString *query = [NSString stringWithFormat:@"insert into SpecialDeals(title,detail,startDate,endDate,branch,pic,thumb) values('%@','%@','%@','%@','%@','%@','%@')", title,detail,startDate,endDate, branch ,image,thumb];
[self InsUpdateDelData:query];
}
и мой журнал отказ
Success Query: insert into SpecialDeals(title,detail,startDate,endDate,branch,pic,thumb) values('The Lounge Manic Mondays','Mighty Mondays Offer: Get 50% discount on foot massage on 29th Sept, 2014. Start booking your appointments from Thursday 25th Sept, 2014.','2014-09-29','2014-09-29','DHA & Gulberg lahore, Islamabad and Peshawar','20442014074407.jpg','20442014074407.jpg')
2014-09-20 19:44:13.432 Depilex[3761:60b] path is... /var/mobile/Applications/7090E701-CC89-40E7-B791-BBF89ACEA0F6/Documents/20442014074413.jpg
2014-09-20 19:44:13.453 Depilex[3761:60b] path is... /var/mobile/Applications/7090E701-CC89-40E7-B791-BBF89ACEA0F6/Documents/20442014074413.jpg
Success Query: insert into SpecialDeals(title,detail,startDate,endDate,branch,pic,thumb) values('The Lounge Manic Mondays','Mighty Mondays Offer: Get 50% off on shave on 22nd Sept, 2014. Start booking your appointments from Thursday 18th Sept, 2014.','2014-09-22','2014-09-22','DHA & Gulberg lahore , Islamabad & Peshawar','20442014074413.jpg','20442014074413.jpg')
2014-09-20 19:44:25.107 Depilex[3761:60b] path is... /var/mobile/Applications/7090E701-CC89-40E7-B791-BBF89ACEA0F6/Documents/20442014074424.jpg
2014-09-20 19:44:25.129 Depilex[3761:60b] path is... /var/mobile/Applications/7090E701-CC89-40E7-B791-BBF89ACEA0F6/Documents/20442014074425.jpg
Failure Query: insert into SpecialDeals(title,detail,startDate,endDate,branch,pic,thumb) values('The Lounge Student Ambassador Deal','The Lounge is looking for Student Ambassador in today's fast paced , modern, fashionable and trendy world !','2014-08-24','2014-09-29','DHA & Gulberg','20442014074424.jpg','20442014074425.jpg')
2014-09-20 19:44:25.131 Depilex[3761:60b] SQL ERROR: near "s": syntax error. In Statement: insert into SpecialDeals(title,detail,startDate,endDate,branch,pic,thumb) values('The Lounge Student Ambassador Deal','The Lounge is looking for Student Ambassador in today's fast paced , modern, fashionable and trendy world !','2014-08-24','2014-09-29','DHA & Gulberg','20442014074424.jpg','20442014074425.jpg')
2014-09-20 19:44:56.123 Depilex[3761:60b] path is... /var/mobile/Applications/7090E701-CC89-40E7-B791-BBF89ACEA0F6/Documents/20442014074451.jpg
2014-09-20 19:44:56.146 Depilex[3761:60b] path is... /var/mobile/Applications/7090E701-CC89-40E7-B791-BBF89ACEA0F6/Documents/20442014074456.jpg
Failure Query: insert into SpecialDeals(title,detail,startDate,endDate,branch,pic,thumb) values('Sante Student Brand Ambassodor','Sante The Salon is looking for a smart motivated, Fabulous ,social butterfly to represent us in today's modern & fashionable world.','2014-09-15','2014-10-31','Gulberg lahore','20452014074527.jpg','20452014074528.jpg')
2014-09-20 19:45:28.198 Depilex[3761:60b] SQL ERROR: near "s": syntax error. In Statement: insert into SpecialDeals(title,detail,startDate,endDate,branch,pic,thumb) values('Sante Student Brand Ambassodor','Sante The Salon is looking for a smart motivated, Fabulous ,social butterfly to represent us in today's modern & fashionable world.','2014-09-15','2014-10-31','Gulberg lahore','20452014074527.jpg','20452014074528.jpg')
Ваши строки имеют апострофа в них, которые закрывают ваши строки в запросе. [Вы никогда не должны просто вставлять данные в виде строк в середине ваших запросов, поскольку это уязвимо для SQL-инъекции] (http://bobby-tables.com/) –