Count Number of Columns That Are Not Empty:PHP MYSQL

Hello friends,
I have written the following script to count the columns which are not empty.
In the following script i have taken a scenario where student’s batch-days are supposed to be counted.

 

<?php
$sql="SELECT sum((monday_time_from IS NOT NULL and monday_time_from <> '') +
(tuesday_time_from IS NOT NULL and tuesday_time_from <> '') +
(wednesday_time_from IS NOT NULL and wednesday_time_from <> '') +
(thursday_time_from IS NOT NULL and thursday_time_from <> '') +
(friday_time_from IS NOT NULL and friday_time_from <> '') +
(saturday_time_from IS NOT NULL and saturday_time_from <> '') +
(sunday_time_from IS NOT NULL and sunday_time_from <> '')) as total
from batches WHERE student_id='$student_id' ";

//change monday_time_from,tuesday_time_from,... with your column names
$result = mysql_query($sql);
$data=mysql_fetch_assoc($result);
echo $number_of_days=$data['total'];

?>

648 thoughts on “Count Number of Columns That Are Not Empty:PHP MYSQL

  1. Pingback: Google
  2. Pingback: Google
  3. Pingback: 토토사이트
  4. Pingback: 사다리사이트
  5. Pingback: 안전놀이터
  6. Pingback: 먹튀검증
  7. Pingback: ventrilopo
  8. Pingback: silicone vibrators
  9. Pingback: vibrator for women
  10. Pingback: double dildos
  11. Pingback: смотрите
  12. Pingback: beast tv apk
  13. Pingback: item shop
  14. Pingback: big double dong
  15. Pingback: порно чат
  16. Pingback: 먹튀그램
  17. Pingback: cursos online
  18. Pingback: fbv cursos grátis
  19. Pingback: Google
  20. Pingback: Google
  21. Pingback: Judi online
  22. Pingback: raiders
  23. Pingback: bondage toys
  24. Pingback: Deals on goods
  25. Pingback: FIFA 19 Coins
  26. Pingback: g spot vibrator
  27. Pingback: silicone wand
  28. Pingback: Detroit SEO
  29. Pingback: Chicago SEO
  30. Pingback: multqa.ae
  31. Pingback: cursos online
  32. Pingback: magic massager
  33. Pingback: curve massager
  34. Pingback: chwilówki
  35. Pingback: iphone repair nyc
  36. Pingback: penis rings
  37. Pingback: vibrato lesson
  38. Pingback: Porn City
  39. Pingback: panty vibrator
  40. Pingback: suction cup dildo
  41. Pingback: find a brides site
  42. Pingback: data entry jobs
  43. Pingback: los angeles seo
  44. Pingback: xxnxx
  45. Pingback: Rabbit Vibe
  46. Pingback: best anal toys
  47. Pingback: penis pump
  48. Pingback: anal
  49. Pingback: strapless dildo
  50. Pingback: fun88
  51. Pingback: 188bet
  52. Pingback: pc app
  53. Pingback: penis pump
  54. Pingback: sekscamera
  55. Pingback: sexy gatas na web
  56. Pingback: rencontres sexe
  57. Pingback: anal trainer
  58. Pingback: speelgoed kopen
  59. Pingback: pc app
  60. Pingback: hamptonbaylight
  61. Pingback: cursos gratuitos
  62. Pingback: Times of India
  63. Pingback: dani pussy
  64. Pingback: shemale dating
  65. Pingback: webcambabes
  66. Pingback: wireless anal plug
  67. Pingback: dildo and balls
  68. Pingback: male masturbator
  69. Pingback: anal vibrator
  70. Pingback: sex toy store
  71. Pingback: gay anal toys
  72. Pingback: massive dildo
  73. Pingback: strap ons
  74. Pingback: top male stroker
  75. Pingback: male pump
  76. Pingback: new dildo
  77. Pingback: vibrator for her
  78. Pingback: 7 inches dong
  79. Pingback: bum plugs
  80. Pingback: Tadapox
  81. Pingback: realistic vibrator
  82. Pingback: app testing job
  83. Pingback: glands ring
  84. Pingback: dildos
  85. Pingback: erotic vibrator
  86. Pingback: big dildo reviews
  87. Pingback: blockchain advisor
  88. Pingback: satta matka
  89. Pingback: pocket masturbator
  90. Pingback: mini egg vibrator
  91. Pingback: male stoker review
  92. Pingback: g spot orgasm
  93. Pingback: vagina dilator
  94. Pingback: anal butt plugs
  95. Pingback: porn
  96. Pingback: pornland
  97. Pingback: gay briefs
  98. Pingback: powerdirector app
  99. Pingback: how to suck cock
  100. Pingback: mountain bikes
  101. Pingback: pocket stroker
  102. Pingback: rubbish bin hire
  103. Pingback: legal
  104. Pingback: real dildo
  105. Pingback: sex toy collection
  106. Pingback: spanking paddle
  107. Pingback: bullet vibe
  108. Pingback: brisbane web
  109. Pingback: gips mallen
  110. Pingback: 15% minoxidil
  111. Pingback: Cialis
  112. Pingback: hundeseng i plast
  113. Pingback: discover here
  114. Pingback: Julia Ann
  115. Pingback: bdjob
  116. Pingback: Fashion Station
  117. Pingback: Pakistani Suits
  118. Pingback: Pool Supplies
  119. Pingback: sexboer
  120. Pingback: porno files
  121. Pingback: geile sex filmpjes
  122. Pingback: gratis films
  123. Pingback: pornofilmpjes
  124. Pingback: liteblue login
  125. Pingback: liteblue
  126. Pingback: maxi wanachi
  127. Pingback: virtual Mastercard
  128. Pingback: finger vibrator
  129. Pingback: vixen vibe
  130. Pingback: powerking maus
  131. Pingback: cruise
  132. Pingback: hunde kurv
  133. Pingback: nipple clamps
  134. Pingback: beeg com
  135. Pingback: plus size toys
  136. Pingback: Bluechew reviews
  137. Pingback: onewalmart.com
  138. Pingback: Don Juravin
  139. Pingback: ormekur hvalpe
  140. Pingback: type 1 diabetes
  141. Pingback: best bondage kit
  142. Pingback: gay toy bondage
  143. Pingback: anal lubricant
  144. Pingback: sex toys
  145. Pingback: poker qq online
  146. Pingback: situs poker asli
  147. Pingback: best vibrator
  148. Pingback: my first vibrator
  149. Pingback: Free Funding
  150. Pingback: using vibrators
  151. Pingback: Yahoo Mail Sign In
  152. Pingback: Gmail sign in
  153. Pingback: Google
  154. Pingback: seo consulting
  155. Pingback: gay thong
  156. Pingback: Copenhagen games
  157. Pingback: pocket pussy
  158. Pingback: mide 676
  159. Pingback: xlxx
  160. Pingback: YtMp3
  161. Pingback: prostate vibe
  162. Pingback: one walmart login
  163. Pingback: mp3
  164. Pingback: SSNI-547
  165. Pingback: anal training kit
  166. Pingback: Strapon milf mom
  167. Pingback: Follower
  168. Pingback: seo
  169. Pingback: toy storage box
  170. Pingback: هوت سبوت
  171. Pingback: gay porn dildo
  172. Pingback: penis growth
  173. Pingback: prepaidgiftbalance
  174. Pingback: NHDTB-305
  175. Pingback: cawd 002
  176. Pingback: glowing dildo
  177. Pingback: gay cock ring sex
  178. Pingback: easy guitar licks
  179. Pingback: credit card buy
  180. Pingback: agen judi online
  181. Pingback: app for laptop
  182. Pingback: virtual number buy
  183. Pingback: Dank Vapes
  184. Pingback: Boston Car Service
  185. Pingback: Eweka
  186. Pingback: numb spray
  187. Pingback: minyak kelapa VCO
  188. Pingback: mywalmart schedule
  189. Pingback: bullet vibe
  190. Pingback: exotic cartridges
  191. Pingback: Dank Vapes
  192. Pingback: stiiizy pods
  193. Pingback: Dank Vapes
  194. Pingback: Vape Pens For Sale
  195. Pingback: THC vape juice
  196. Pingback: Buy Modafinil
  197. Pingback: Tramadol for Sale
  198. Pingback: online business
  199. Pingback: Blackjack System
  200. Pingback: Tramadol Online
  201. Pingback: runelite
  202. Pingback: MEYD-532
  203. Pingback: Beautiful t shirts
  204. Pingback: Women clothing
  205. Pingback: 618media.com
  206. Pingback: male masturbator
  207. Pingback: kawhi
  208. Pingback: buy xanax online
  209. Pingback: Dankwoods
  210. Pingback: properties UK
  211. Pingback: nipple clamps
  212. Pingback: numbing anal lube
  213. Pingback: logo designers
  214. Pingback: Agen Judi Slot
  215. Pingback: IPX-368
  216. Pingback: one.walmart.com
  217. Pingback: anal vibrator
  218. Pingback: SEO Vancouver
  219. Pingback: PPPD-792
  220. Pingback: HUNTA-652
  221. Pingback: pc games download
  222. Pingback: gay anal trainer
  223. Pingback: pegging couple
  224. Pingback: milfgilf sex
  225. Pingback: crazybulk review
  226. Pingback: CAWD 016
  227. Pingback: XVSR-499
  228. Pingback: air Jordan
  229. Pingback: sewa led
  230. Pingback: nipple toys
  231. Pingback: sneaker
  232. Pingback: Wegmans connect
  233. Pingback: Thc vape juice
  234. Pingback: cat crap anti fog
  235. Pingback: celebrity pussy
  236. Pingback: rotating vibrator
  237. Pingback: MIDE-687
  238. Pingback: WANZ-893
  239. Pingback: Vape shop near me
  240. Pingback: free porn xxx
  241. Pingback: latest jobs update
  242. Pingback: free apk download
  243. Pingback: Vape shop near me
  244. Pingback: Vincent Lesane
  245. Pingback: flexy spy
  246. Pingback: erfahrungen mspy
  247. Pingback: usps liteblue
  248. Pingback: BBAN-248
  249. Pingback: best double dildo
  250. Pingback: best penis ring
  251. Pingback: love egg
  252. Pingback: Buy Fake Money
  253. Pingback: BBC iPlayer
  254. Pingback: jewelry stores
  255. Pingback: Best smm panel
  256. Pingback: anal massage
  257. Pingback: Dankwoods
  258. Pingback: TEFL jobs
  259. Pingback: Century Sankya
  260. Pingback: buy viagra
  261. Pingback: viagra
  262. Pingback: Xenon XP
  263. Pingback: buy weeds online
  264. Pingback: magic wand review
  265. Pingback: women with tattoo
  266. Pingback: free apk download
  267. Pingback: xanax
  268. Pingback: cbd oil for sale
  269. Pingback: viagra
  270. Pingback: cialis
  271. Pingback: stopoverdoseil.org
  272. Pingback: butterfly vibrator
  273. Pingback: how to use a dildo
  274. Pingback: vibrator challenge
  275. Pingback: convertidor mp3
  276. Pingback: VALCIVIR 500 (1x3)
  277. Pingback: top smm panel
  278. Pingback: vibrating wand
  279. Pingback: sex position swing
  280. Pingback: bondage sex kit
  281. Pingback: silicone vibrator
  282. Pingback: male bondage toys
  283. Pingback: penis rings
  284. Pingback: realistic dildos
  285. Pingback: popular vibrators
  286. Pingback: penis mold kit
  287. Pingback: Research
  288. Pingback: viagra
  289. Pingback: viagra
  290. Pingback: viagra
  291. Pingback: viagra
  292. Pingback: viagra
  293. Pingback: viagra
  294. Pingback: viagra
  295. Pingback: viagra
  296. Pingback: dildo
  297. Pingback: pc app
  298. Pingback: robux hacker
  299. Pingback: casual encounters
  300. Pingback: spins hack apk
  301. Pingback: VIAGRA
  302. Pingback: FREE V BUCKS
  303. Pingback: free robux hack
  304. Pingback: porn
  305. Pingback: anal play
  306. Pingback: viagra men
  307. Pingback: anal sex toys
  308. Pingback: Watch HUSTLER
  309. Pingback: fortnite vbucks
  310. Pingback: realistic dildo
  311. Pingback: online investment
  312. Pingback: malaysia escorts
  313. Pingback: panty vibrator
  314. Pingback: pornhub
  315. Pingback: robux generator
  316. Pingback: Chattermeet
  317. Pingback: extortion website
  318. Pingback: eve first thruster
  319. Pingback: Porn
  320. Pingback: casual encounters
  321. Pingback: Top Media Markt
  322. Pingback: x-rated
  323. Pingback: viagra pills
  324. Pingback: bunny vibe
  325. Pingback: dating
  326. Pingback: masturbator toy
  327. Pingback: fast food near me
  328. Pingback: streamay
  329. Pingback: buy dildo
  330. Pingback: adam and eve dildo
  331. Pingback: 메이저사이트
  332. Pingback: 먹튀검증
  333. Pingback: 손오공
  334. Pingback: 먹튀사이트
  335. Pingback: dominos promo code
  336. Pingback: SEX
  337. Pingback: roblox free robux
  338. Pingback: cozaar
  339. Pingback: viagra
  340. Pingback: 먹튀사이트
  341. Pingback: 카지노사이트
  342. Pingback: cbd oil
  343. Pingback: Cleaners Melbourne
  344. Pingback: Exotic Pet Shop
  345. Pingback: biaxin
  346. Pingback: personals
  347. Pingback: biiig
  348. Pingback: Sauna
  349. Pingback: Film Streaming
  350. Pingback: Threema Messenger
  351. Pingback: TIKB-060
  352. Pingback: SSNI-620
  353. Pingback: foreplay sex

Leave a Reply