Create a query box same as PHP-MyAdmin

Hello everyone,
Once I had a task to create a query-box, which is similar to phpmyadmin SQL tab.
Following the code which I wrote for it.
It is very useful in the cases where you know the data structure and you don’t want to open cpanel again and again to check the code.

/*
1. Create a file called fetch_data_api.php
Put following code into it.
*/
<font color=”red”><B>ENTER YOUR MYSQL QUERY HERE:</B></font>
<BR>
<form action=”#” method=”POST”>
<textarea  name=”run_query” rows=”4″ cols=”50″>
</textarea>

<input type=”SUBMIT” name=”submit”>
</form>
<br>
<?php
if (isset($_POST[‘submit’])) {
echo “<br>”;
echo $run_query= $_POST[‘run_query’];
echo “<br>”;
// create curl resource
$ch = curl_init();
// is cURL installed yet?
if ($ch){
//      echo (‘ cURL is  installed!’);
}
// set url
$set_url = curl_setopt($ch, CURLOPT_URL, “http://yourdomain/yourfolder/fetch_data_sql.php”);

if($set_url)
{
// echo “URL SET”;
}

curl_setopt($ch, CURLOPT_POST, true);  // tell curl you want to post something
curl_setopt($ch, CURLOPT_POSTFIELDS, “run_query=”.$run_query);
//return the transfer as a string
$trasfer =curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if($trasfer)
{
// echo “transfer”;
}
// $output contains the output string
$output = curl_exec($ch);
// echo $output;
if($output)
{
// echo “EXECUTED”;
}
else
{
// echo “Error Number:”.curl_errno($ch).”<br>”;
//       echo “Error String:”.curl_error($ch);
}

//exit();
// close curl resource to free up system resources
curl_close($ch);
$array = json_decode( $output, true );;
//print_r($array);

echo ‘<table border=”1″ cellspacing=”0″ cellpadding=”0″ width=”100%”>’;
// print table header
echo “<thead><tr>”;
foreach($array[0] as $key=>$value){
echo “<th>$key</th>”;
}
echo “</tr></thead>”;
foreach($array as $row) {
echo(‘<tr>’);
foreach($row as $cell) {
echo(‘<td>’ . $cell . ‘</td>’);
}
echo(‘</tr>’);
}
echo ‘</table>’;
}
?>


/*2. create file called: fetch_data_sql.php*/
<?php
header(“Access-Control-Allow-Origin: *”);
header(“Content-Type: application/json; charset=UTF-8”);

$servername = “localhost”; //hostname
$username = “root”; //username
$password = “”; //your password

$dbname = “db1”;

$dbh1 = mysql_connect($servername, $username, $password);

mysql_select_db($dbname, $dbh1);

$run_query=$_POST[‘run_query’];

$sql=mysql_query($run_query);
$arr_json = array();
$json= “[“;
while ($row = mysql_fetch_assoc($sql)) {
if ($json != “[“) {$json .= “,”;}
$json .= json_encode($row);
$arr_json[] .= $json;
}

$json .= “]”;
echo($json);

?>

882 thoughts on “Create a query box same as PHP-MyAdmin

  1. Pingback: Google
  2. Pingback: Google
  3. Pingback: 토토사이트
  4. Pingback: porn massage
  5. Pingback: hunting equipment
  6. Pingback: bondage set
  7. Pingback: 먹튀검증
  8. Pingback: ADM Chapter 13
  9. Pingback: ONGC Requirement
  10. Pingback: kegel wand
  11. Pingback: luxury sex toys
  12. Pingback: shmmovers.com
  13. Pingback: Big Cock
  14. Pingback: thrusting dildo
  15. Pingback: chwilówki
  16. Pingback: ipad screen repair
  17. Pingback: penis extender
  18. Pingback: bullet massager
  19. Pingback: male prostate toy
  20. Pingback: real feel dildo
  21. Pingback: Nerf Gun
  22. Pingback: mail order bride
  23. Pingback: xxnxx
  24. Pingback: anal sex toys
  25. Pingback: Expensive
  26. Pingback: butt plugs
  27. Pingback: penis enlarger
  28. Pingback: kegel balls
  29. Pingback: strapless strap on
  30. Pingback: 188bet
  31. Pingback: rijpe vrouw
  32. Pingback: sekscamera
  33. Pingback: sl-m2070wxaa
  34. Pingback: apps for pc
  35. Pingback: cameras ao vivo
  36. Pingback: rencontres adulte
  37. Pingback: anal butt plug
  38. Pingback: how to anal douche
  39. Pingback: play free pc games
  40. Pingback: bullet vibrator
  41. Pingback: hamptonbaylight
  42. Pingback: Times of India
  43. Pingback: cock ring
  44. Pingback: dani best videos
  45. Pingback: dong vibrator
  46. Pingback: silicone vibrator
  47. Pingback: sexe webcam
  48. Pingback: sexe webcam
  49. Pingback: top thrusting toy
  50. Pingback: prostate sex toy
  51. Pingback: sex toys
  52. Pingback: gay huge dildo
  53. Pingback: realistic stroker
  54. Pingback: strap ons
  55. Pingback: weird sex toy
  56. Pingback: Porn Land
  57. Pingback: anal training kit
  58. Pingback: Snovitra Strong
  59. Pingback: smt1500rm2u manual
  60. Pingback: penis vacuum pump
  61. Pingback: male glans ring
  62. Pingback: vaginal balls
  63. Pingback: squirting dildo
  64. Pingback: big didlo
  65. Pingback: rabbit vibrator
  66. Pingback: foreplay games
  67. Pingback: 15% minoxidil
  68. Pingback: pussy stroker
  69. Pingback: thick dildo
  70. Pingback: g spot toy
  71. Pingback: bullet vibe
  72. Pingback: dilator
  73. Pingback: bdsm kit
  74. Pingback: porn land
  75. Pingback: unboxing
  76. Pingback: how to deep throat
  77. Pingback: climbing harness
  78. Pingback: double stroker
  79. Pingback: commission
  80. Pingback: large dong
  81. Pingback: rabbit vibe
  82. Pingback: mens pleasure toys
  83. Pingback: black giant dildo
  84. Pingback: paddle sex
  85. Pingback: latest vibrators
  86. Pingback: bondage sex toys
  87. Pingback: vibrating egg
  88. Pingback: porn land
  89. Pingback: luksus hundeseng
  90. Pingback: pkv gamess secrets
  91. Pingback: Exchange Programs
  92. Pingback: Fashion Station
  93. Pingback: Pool Light
  94. Pingback: sexboer
  95. Pingback: porno files
  96. Pingback: geile sex filmpjes
  97. Pingback: gratis films
  98. Pingback: pornofilmpjes
  99. Pingback: liteblue
  100. Pingback: mini massager
  101. Pingback: dildo
  102. Pingback: virtual visa card
  103. Pingback: travel
  104. Pingback: nipple clamping
  105. Pingback: xvideos
  106. Pingback: double dong
  107. Pingback: one walmart login
  108. Pingback: Bluechew reviews
  109. Pingback: spolorm hund
  110. Pingback: www.hotmail.fr
  111. Pingback: SUC Elibrary
  112. Pingback: gay toy bondage
  113. Pingback: costco hours
  114. Pingback: bullet vibrator
  115. Pingback: podcast
  116. Pingback: ceme online
  117. Pingback: city to city ride
  118. Pingback: g spot vibrator
  119. Pingback: tax free
  120. Pingback: couples penis ring
  121. Pingback: cheap csgo cheats
  122. Pingback: Yahoo Mail Sign In
  123. Pingback: Hotmail Sign In
  124. Pingback: porn free
  125. Pingback: briefs
  126. Pingback: boho bracelet
  127. Pingback: Ultras brand
  128. Pingback: couples sex toys
  129. Pingback: iraniporn
  130. Pingback: mide 676
  131. Pingback: xxx
  132. Pingback: gay toys online
  133. Pingback: YtMp3
  134. Pingback: security
  135. Pingback: hotmail outlook
  136. Pingback: outlook sign in
  137. Pingback: MVSD-397
  138. Pingback: ssni 546
  139. Pingback: glass dildo
  140. Pingback: butt plug set
  141. Pingback: big ass ebony anal
  142. Pingback: Shatta Wale Music
  143. Pingback: ama questions
  144. Pingback: prepaidgiftbalance
  145. Pingback: 192.168 1.254
  146. Pingback: NHDTB-308
  147. Pingback: top 5 sex toys
  148. Pingback: sex video download
  149. Pingback: btc to neteller
  150. Pingback: buttplug porn
  151. Pingback: jockstraps
  152. Pingback: app for pc
  153. Pingback: Eweka
  154. Pingback: numb spray
  155. Pingback: one.walmart.com
  156. Pingback: Dank Vapes
  157. Pingback: Dank Vapes
  158. Pingback: Chat Teen Live
  159. Pingback: Baccarat System
  160. Pingback: ABP 898
  161. Pingback: runelite
  162. Pingback: MEYD-525
  163. Pingback: Women clothing
  164. Pingback: 618media.com
  165. Pingback: hoops
  166. Pingback: Bitcoin news
  167. Pingback: ManyCam Crack
  168. Pingback: Dankwoods
  169. Pingback: valium for sale
  170. Pingback: gay male underwear
  171. Pingback: gay bondage gear
  172. Pingback: dank cartridges
  173. Pingback: logo designers
  174. Pingback: jelly vibrator
  175. Pingback: anal douching
  176. Pingback: SEO Vancouver
  177. Pingback: daftar joker123
  178. Pingback: GVG 941
  179. Pingback: Mumbai Escorts
  180. Pingback: ama
  181. Pingback: milfgilf porn
  182. Pingback: crazybulk estafa
  183. Pingback: OYC 278
  184. Pingback: CESD-812
  185. Pingback: sewa led screen
  186. Pingback: air Jordan
  187. Pingback: عرب نار
  188. Pingback: giant dildo
  189. Pingback: nipple suckers
  190. Pingback: hotmail sign in
  191. Pingback: Thc vape juice
  192. Pingback: vape shop
  193. Pingback: g spot
  194. Pingback: Tagius events
  195. Pingback: web hosting
  196. Pingback: MIDE 685
  197. Pingback: MIAA-159
  198. Pingback: txxx porn
  199. Pingback: Vape near me
  200. Pingback: buy vape online
  201. Pingback: app for laptop
  202. Pingback: THC vape juice
  203. Pingback: vape shop online
  204. Pingback: Roselle Prost
  205. Pingback: flexi spy
  206. Pingback: ABP 906
  207. Pingback: ADN-227
  208. Pingback: liteblue
  209. Pingback: dildos
  210. Pingback: virtual debit card
  211. Pingback: jewelry stores
  212. Pingback: oxycodone for sale
  213. Pingback: cypionate online
  214. Pingback: Best smm panel
  215. Pingback: prostate sex toys
  216. Pingback: pc app
  217. Pingback: Mario cart
  218. Pingback: weed for sale
  219. Pingback: info
  220. Pingback: Order marijuana
  221. Pingback: TEFL jobs
  222. Pingback: american whopper
  223. Pingback: Century Sankya
  224. Pingback: viagra
  225. Pingback: buy viagra
  226. Pingback: free app download
  227. Pingback: cheap mattress
  228. Pingback: viagra
  229. Pingback: cbd for sale
  230. Pingback: cbd oil for sale
  231. Pingback: cialis
  232. Pingback: stopoverdoseil.org
  233. Pingback: buy lipitor online
  234. Pingback: vibrator
  235. Pingback: SILAGRA (1X4)
  236. Pingback: smm panels
  237. Pingback: love swing
  238. Pingback: sex flogger
  239. Pingback: bondage sex kit
  240. Pingback: strapons
  241. Pingback: anal toys for men
  242. Pingback: girth enlargement
  243. Pingback: huge girthy dildo
  244. Pingback: popular vibrators
  245. Pingback: سکس مقعدی
  246. Pingback: Chiang Mai
  247. Pingback: viagra
  248. Pingback: viagra
  249. Pingback: viagra
  250. Pingback: viagra
  251. Pingback: viagra
  252. Pingback: viagra
  253. Pingback: viagra
  254. Pingback: viagra
  255. Pingback: viagra
  256. Pingback: porn toys
  257. Pingback: VIAGRA
  258. Pingback: xxx
  259. Pingback: tummy tuck surgery
  260. Pingback: VIAGRA
  261. Pingback: pornhub
  262. Pingback: training anal toys
  263. Pingback: hack robux and tix
  264. Pingback: dạy make up
  265. Pingback: ee 123 Movies
  266. Pingback: dildos
  267. Pingback: virtual visacard
  268. Pingback: anal starter kit
  269. Pingback: pornhub
  270. Pingback: robux free
  271. Pingback: get free v bucks
  272. Pingback: phishing website
  273. Pingback: male prostate toy
  274. Pingback: pornhub
  275. Pingback: generic cialis
  276. Pingback: Top Media Markt
  277. Pingback: anime
  278. Pingback: rabbit vibrator
  279. Pingback: male stroker toy
  280. Pingback: viagra men
  281. Pingback: filmzenstream
  282. Pingback: buy butt plugs
  283. Pingback: dildo experience
  284. Pingback: 메이저놀이터
  285. Pingback: 검증사이트
  286. Pingback: movies
  287. Pingback: 먹튀업체
  288. Pingback: pizza coupon codes
  289. Pingback: free robux codes
  290. Pingback: SPAM
  291. Pingback: escort directory
  292. Pingback: remote dildo
  293. Pingback: laws
  294. Pingback: generic cialis
  295. Pingback: 먹튀검증
  296. Pingback: cbd oil
  297. Pingback: cbd
  298. Pingback: anal vibrator
  299. Pingback: Local Pet Shops
  300. Pingback: nasonex
  301. Pingback: laws
  302. Pingback: PORN DOWNLOAD
  303. Pingback: biiig
  304. Pingback: Film Streaming
  305. Pingback: Infrared Cabin
  306. Pingback: Threema
  307. Pingback: MVSD-410
  308. Pingback: SSNI 628
  309. Pingback: couple cuddling
  310. Pingback: anal trainer kit
  311. Pingback: kinokrad
  312. Pingback: dv lottery
  313. Pingback: xxx
  314. Pingback: peliculas online
  315. Pingback: male penis pump
  316. Pingback: asmr
  317. Pingback: software download
  318. Pingback: SILAGRA (1X4)
  319. Pingback: Amsterdam escort
  320. Pingback: businesses wanted
  321. Pingback: filmy-kinokrad
  322. Pingback: serial
  323. Pingback: HND-753
  324. Pingback: yell websites
  325. Pingback: wand massager
  326. Pingback: masturbators
  327. Pingback: steroids for sale
  328. Pingback: vibrating bullet
  329. Pingback: sex toys
  330. Pingback: anal sex toy
  331. Pingback: ăn sáng ngon q1
  332. Pingback: Famous hunters
  333. Pingback: JAV
  334. Pingback: seo publissoft
  335. Pingback: spices grinder
  336. Pingback: holmes blackboard
  337. Pingback: fast food near me
  338. Pingback: crm free download
  339. Pingback: cerialest.ru
  340. Pingback: Mesothelioma
  341. Pingback: VIAGRA
  342. Pingback: AFFLIATE programs
  343. Pingback: free robux gg
  344. Pingback: prostate milking
  345. Pingback: multivibrator
  346. Pingback: #trading
  347. Pingback: big dildos
  348. Pingback: dildo for men
  349. Pingback: dildo asmr
  350. Pingback: sex massage
  351. Pingback: asmr anal
  352. Pingback: crowne plaza hotel
  353. Pingback: blackhat seo links
  354. Pingback: Anti-Bacterial
  355. Pingback: vibrators
  356. Pingback: 토토사이트
  357. Pingback: organic seeds
  358. Pingback: Donovan
  359. Pingback: best bondage gear
  360. Pingback: katmovies
  361. Pingback: Buy blackhat SEO
  362. Pingback: vibrator review
  363. Pingback: 우리카지노
  364. Pingback: 퍼스트카지노
  365. Pingback: 코인카지노
  366. Pingback: 예스카지노
  367. Pingback: travel
  368. Pingback: silicone vibrators
  369. Pingback: mens stroker
  370. Pingback: PORNHUB
  371. Pingback: FREE SEX
  372. Pingback: web designing
  373. Pingback: Poeboy
  374. Pingback: large dildo
  375. Pingback: prowizja/prowizji
  376. Pingback: best clit vibrator
  377. Pingback: prowizja/prowizji
  378. Pingback: sex
  379. Pingback: top sex toys
  380. Pingback: Dog Bandanas
  381. Pingback: FREE ROBUX 2020
  382. Pingback: dildo
  383. Pingback: oneplus coupon
  384. Pingback: buy phen375
  385. Pingback: rotating vibrator
  386. Pingback: clit sucker
  387. Pingback: realistic dildos
  388. Pingback: male sex toy
  389. Pingback: wand massager
  390. Pingback: app for laptop,
  391. Pingback: PORN DOWNLOAD
  392. Pingback: bofilm
  393. Pingback: 1 seriya
  394. Pingback: more..
  395. Pingback: masturbator sleeve
  396. Pingback: CHEAP VIAGRA
  397. Pingback: penis extender
  398. Pingback: VIAGRA
  399. Pingback: roblox robux
  400. Pingback: gamesfriv
  401. Pingback: biaxin
  402. Pingback: SEO
  403. Pingback: best cbd for sleep
  404. Pingback: giày yeezy
  405. Pingback: topedstoreusa.com
  406. Pingback: CHEAP VIAGRA
  407. Pingback: CHEAP SEX OFFLINE
  408. Pingback: کوس
  409. Pingback: Dominanta
  410. Pingback: beta (bukva)
  411. Pingback: masturbator sleeve
  412. Pingback: adam and eve store
  413. Pingback: adam’s dildo
  414. Pingback: biography wiki
  415. Pingback: FREE SEX
  416. Pingback: remote panty vibe
  417. Pingback: adam and eve haul
  418. Pingback: anal plugs
  419. Pingback: best male stroker
  420. Pingback: anal plug vibrator
  421. Pingback: rabbit vibrator
  422. Pingback: best rabbit vibe
  423. Pingback: restaurants
  424. Pingback: restaurants
  425. Pingback: SEX ONLINE
  426. Pingback: smart devices
  427. Pingback: onewalmartwire
  428. Pingback: FREE ROBUX
  429. Pingback: Naija songs
  430. Pingback: hqcialismht.com
  431. Pingback: penis extension
  432. Pingback: ABP-937
  433. Pingback: SSNI 672
  434. Pingback: terjemahan
  435. Pingback: SEX
  436. Pingback: url

Leave a Reply