forked from ezSQL/ezsql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ez_sql_help.htm
3731 lines (2664 loc) · 193 KB
/
ez_sql_help.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=Generator content="Microsoft Word 11 (filtered)">
<title>Introduction</title>
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";
color:windowtext;}
h1
{margin:0cm;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:10.0pt;
font-family:"Times New Roman";
color:windowtext;
font-weight:bold;}
h2
{margin:0cm;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:14.0pt;
font-family:Arial;
color:windowtext;
font-weight:bold;}
h3
{margin:0cm;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:10.0pt;
font-family:Arial;
color:windowtext;
font-weight:bold;
font-style:italic;}
h4
{margin:0cm;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:12.0pt;
font-family:Arial;
color:navy;
font-weight:bold;}
h5
{margin:0cm;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:11.0pt;
font-family:Arial;
color:navy;
font-weight:bold;
font-style:italic;}
h6
{margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:11.0pt;
font-family:Arial;
color:navy;
font-weight:bold;
font-style:italic;}
p.MsoHeading7, li.MsoHeading7, div.MsoHeading7
{margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:108.0pt;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:11.0pt;
font-family:Arial;
color:#003366;
font-style:italic;}
p.MsoHeading8, li.MsoHeading8, div.MsoHeading8
{margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:11.0pt;
font-family:Arial;
color:black;
font-weight:bold;}
p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
{margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:Arial;
color:windowtext;}
p.MsoBodyTextIndent, li.MsoBodyTextIndent, div.MsoBodyTextIndent
{margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:Arial;
color:windowtext;}
p.MsoBodyText2, li.MsoBodyText2, div.MsoBodyText2
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:Arial;
color:windowtext;}
p.MsoBodyTextIndent2, li.MsoBodyTextIndent2, div.MsoBodyTextIndent2
{margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:Arial;
color:#003366;}
p.MsoBodyTextIndent3, li.MsoBodyTextIndent3, div.MsoBodyTextIndent3
{margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:Arial;
color:black;
font-style:italic;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p
{margin-right:0cm;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman";
color:black;}
p.msonormalc12, li.msonormalc12, div.msonormalc12
{margin-right:0cm;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman";
color:black;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
/* List Definitions */
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>
</head>
<body lang=EN-GB link=blue vlink=purple>
<div class=Section1>
<h1><span style='font-size:14.0pt;font-family:Arial;color:navy;font-weight:
normal'>ezSQL Overview </span><span style='font-size:7.5pt;font-family:Arial;
color:navy;font-weight:normal'><a
href="http://php.justinvincent.com/download.php?ez_sql">download ez_sql.zip</a><br>
To email the creator: justin_at_jvmultimedia_dot_com</span></h1>
<p class=MsoNormal style='margin-left:18.0pt'><b><span style='font-size:10.0pt;
font-family:Arial;color:#003366'> </span></b></p>
<p class=MsoBodyText style='margin-left:36.0pt;text-indent:-18.0pt'><span
style='font-size:11.0pt;font-family:Symbol;color:#003366'>·</span><span
style='font-size:7.0pt;font-family:"Times New Roman";color:#003366'>
</span><span style='font-size:11.0pt;color:#003366'>ezSQL is a widget that
makes it very fast and easy for you to use database(s) within your PHP scripts
( mySQL / Oracle8/9 / InterBase/FireBird / PostgreSQL / MS-SQL / SQLite /
SQLite c++).</span></p>
<p class=MsoNormal style='text-indent:3.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoBodyText2 style='margin-left:36.0pt;text-indent:-18.0pt'><span
style='font-family:Symbol;color:#003366'>·</span><span style='font-size:7.0pt;
font-family:"Times New Roman";color:#003366'>
</span><span style='color:#003366'>It is one php file that you include at the
top of your script. Then, instead of using standard php database functions
listed in the php manual, you use a much smaller (and easier) set of
ezSQL functions.</span></p>
<p class=MsoBodyText2><span style='color:#003366'> </span></p>
<p class=MsoBodyText2 style='margin-left:36.0pt;text-indent:-18.0pt'><span
style='font-family:Symbol;color:#003366'>·</span><span style='font-size:7.0pt;
font-family:"Times New Roman";color:#003366'>
</span><span style='color:#003366'>It automatically caches query results and
allows you to use easy to understand functions to manipulate and extract them
without causing extra server overhead</span></p>
<p class=MsoBodyText2><span style='color:#003366'> </span></p>
<p class=MsoBodyText2 style='margin-left:36.0pt;text-indent:-18.0pt'><span
style='font-family:Symbol;color:#003366'>·</span><span style='font-size:7.0pt;
font-family:"Times New Roman";color:#003366'>
</span><span style='color:#003366'>It has excellent debug functions making it
lightning-fast to see what’s going on in your SQL code</span></p>
<p class=MsoBodyText2><span style='color:#003366'> </span></p>
<p class=MsoBodyText2 style='margin-left:36.0pt;text-indent:-18.0pt'><span
style='font-family:Symbol;color:#003366'>·</span><span style='font-size:7.0pt;
font-family:"Times New Roman";color:#003366'>
</span><span style='color:#003366'>Most ezSQL functions can return results as
Objects, Associative Arrays, or Numerical Arrays</span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt'><span
style='font-size:11.0pt;font-family:Symbol;color:#003366'>·</span><span
style='font-size:7.0pt;color:#003366'>
</span><span style='font-size:11.0pt;font-family:Arial;color:#003366'>It can
dramatically decrease development time and in most cases will streamline your
code and make things run faster as well as making it very easy to debug and
optimise your database queries.</span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt'><span
style='font-size:11.0pt;font-family:Symbol;color:#003366'>·</span><span
style='font-size:7.0pt;color:#003366'>
</span><span style='font-size:11.0pt;font-family:Arial;color:#003366'>It is a
small class and will not add very much overhead to your website.</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:gray'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><b><i><span style='font-size:
11.0pt;font-family:Arial;color:#003366'>Note:</span></i></b><i><span
style='font-size:11.0pt;font-family:Arial;color:#003366'> It is assumed that
you are familiar with PHP, basic Database concepts and basic SQL constructs.
Even if you are a complete beginner ezSQL can help you once you have read and
understood <u><a href="http://www.jvmultimedia.com/portal/node/14">this
tutorial</a></u>.</span></i></p>
<p class=MsoNormal style='margin-left:36.0pt'><i><span style='font-size:10.0pt;
font-family:Arial;color:#003366'> </span></i></p>
<div style='border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm'>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:Arial;
color:#003366'> </span></i></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:Arial;
color:#003366'> </span></i></p>
</div>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:Arial;
color:gray'> </span></i></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:Arial;
color:gray'> </span></i></p>
<h1><span style='font-size:14.0pt;font-family:Arial;color:navy;font-weight:
normal'>Quick Examples..</span></h1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:Arial;color:#003366'>Note:
In all these examples no other code is required other than including ez_sql.php</span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:Arial;color:#003366'>
----------------------------------------------------</span></p>
<h1 style='margin-left:36.0pt'><i><span style='font-size:11.0pt;font-family:
Arial;color:navy'>Example 1</span></i></h1>
<p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:purple'>// Select multiple records from the database
and print them out..</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>$users = $db->get_results("SELECT
name, email FROM users");</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>foreach ( $users as $user )</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>{</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
</span><span style='font-size:11.0pt;font-family:Arial;color:purple'>// Access
data using object syntax</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
echo $user->name;</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
echo $user->email;</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>}</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<h1 style='margin-left:36.0pt'><i><span style='font-size:11.0pt;font-family:
Arial;color:navy'>Example 2</span></i></h1>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:purple'>// Get one row from the database and print it
out..</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>$user = $db->get_row("SELECT
name,email FROM users WHERE id = 2");</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>echo $user->name;</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>echo $user->email;</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<h6>Example 3</h6>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:purple'>// Get one variable from the database and print
it out..</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>$var = $db->get_var("SELECT count(*)
FROM users");</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>echo $var;</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<h6>Example 4</h6>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:purple'>// Insert into the database</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>$db->query("INSERT INTO users (id,
name, email) VALUES (NULL,'justin','jv@foo.com')");</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<h6>Example 5</h6>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:purple'>// Update the database</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>$db->query("UPDATE users SET name =
'Justin' WHERE id = 2)");</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<h6>Example 6</h6>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:purple'>// Display last query and all associated
results</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>$db->debug();</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<h6>Example 7</h6>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:purple'>// Display the structure and contents of any
result(s) .. or any variable</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>$results = $db->get_results("SELECT
name, email FROM users");</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>$db->vardump($results);</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<h6>Example 8</h6>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:purple'>// Get 'one column' (based on column index) and
print it out..</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>$names = $db->get_col("SELECT
name,email FROM users",0)</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>foreach ( $names as $name )</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>{</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
echo $name;</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>}</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<h6>Example 9</h6>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:purple'>// Same as above ‘but quicker’</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>foreach ( $db->get_col("SELECT
name,email FROM users",0) as $name )</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>{</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
echo $name;</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>}</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<h6>Example 10</h6>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>----------------------------------------------------</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:purple'>// Map out the full schema of any given
database and print it out..</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>$db->select("my_database");</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>foreach ( $db->get_col("SHOW
TABLES",0) as $table_name )</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>{</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
$db->debug();</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
$db->get_results("DESC $table_name");</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>}</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>$db->debug();</span></p>
<div style='border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm'>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:Arial;
color:#003366'> </span></i></p>
</div>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:Arial;
color:gray'> </span></i></p>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:Arial;
color:gray'> </span></i></p>
<h1><span style='font-size:14.0pt;font-family:Arial;color:navy;font-weight:
normal'>Introduction</span></h1>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:Arial'> </span></b></p>
<p class=MsoBodyText style='margin-left:36.0pt'><span style='font-size:11.0pt;
color:#003366'>When working with databases most of the time you will want to do
one of four types of basic operations.</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:90.0pt;text-indent:-18.0pt'><span
style='font-size:11.0pt;font-family:Arial;color:#003366'>1.</span><span
style='font-size:7.0pt;color:#003366'> </span><span
style='font-size:11.0pt;font-family:Arial;color:#003366'>Perform a query such
as Insert or Update (without results)</span></p>
<p class=MsoNormal style='margin-left:90.0pt;text-indent:-18.0pt'><span
style='font-size:11.0pt;font-family:Arial;color:#003366'>2.</span><span
style='font-size:7.0pt;color:#003366'> </span><span
style='font-size:11.0pt;font-family:Arial;color:#003366'>Get a single variable
from the database</span></p>
<p class=MsoNormal style='margin-left:90.0pt;text-indent:-18.0pt'><span
style='font-size:11.0pt;font-family:Arial;color:#003366'>3.</span><span
style='font-size:7.0pt;color:#003366'> </span><span
style='font-size:11.0pt;font-family:Arial;color:#003366'>Get a single row from
the database</span></p>
<p class=MsoNormal style='margin-left:90.0pt;text-indent:-18.0pt'><span
style='font-size:11.0pt;font-family:Arial;color:#003366'>4.</span><span
style='font-size:7.0pt;color:#003366'> </span><span
style='font-size:11.0pt;font-family:Arial;color:#003366'>Get a list of results
from the database</span></p>
<p class=MsoBodyText style='margin-left:36.0pt'><span style='font-size:11.0pt;
color:#003366'> </span></p>
<p class=MsoBodyText style='margin-left:36.0pt'><span style='font-size:11.0pt;
color:#003366'>ezSQL wraps up these four basic actions into four very easy to
use functions. </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>bool <b>$db->query</b>(query)</span></p>
<p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>var <b>$db->get_var</b>(query)</span></p>
<p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>mixed <b>$db->get_row</b>(query)</span></p>
<p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>mixed <b>$db->get_results</b>(query)</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></b></p>
<p class=MsoBodyText style='margin-left:36.0pt'><span style='font-size:11.0pt;
color:#003366'>With ezSQL these four functions are all you will need 99.9% of
the time. Of course there are also some other useful functions but we will get
into those later.</span></p>
<p class=MsoBodyText style='margin-left:36.0pt'><span style='font-size:11.0pt;
color:#003366'> </span></p>
<p class=MsoBodyText style='margin-left:36.0pt'><b><i><span style='font-size:
11.0pt;color:#003366'>Important Note:</span></i></b><i><span style='font-size:
11.0pt;color:#003366'> If you use ezSQL inside a function you write, you will
need to put <b>global $db;</b> at the top.</span></i></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:Arial'> </span></b></p>
<div style='border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm'>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:Arial;
color:#003366'> </span></i></p>
</div>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:Arial;
color:gray'> </span></i></p>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:Arial'> </span></b></p>
<h1><span style='font-size:14.0pt;font-family:Arial;color:navy;font-weight:
normal'>Installation</span></h1>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:Arial'> </span></b></p>
<p class=MsoBodyText style='margin-left:36.0pt'><span style='font-size:11.0pt;
color:#003366'>To install ezSQL download, unzip and install the contents of <b><a
href="http://php.justinvincent.com/download.php?ez_sql">ez_sql.zip</a></b> into
the same directory within your web server.</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></b></p>
<p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>Put the following at the top of your script:</span></b></p>
<p class=MsoNormal style='margin-left:36.0pt'> </p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> // Include ezSQL core</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> include_once "ez_sql_core.php";</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> // Include ezSQL database specific
component (in this case mySQL)</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> include_once
"ez_sql_mysql.php";</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> // Initialise database object and
establish a connection</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> // at the same time - db_user /
db_password / db_name / db_host</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> $db = new
ezSQL_mysql('db_user','db_password','db_name','db_host');</span></p>
<p class=MsoNormal style='margin-left:36.0pt'> </p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>Note: On most systems <b>localhost</b> will be
fine for the dbhost value. If you are unsure about any of the above settings
you should contact your provider or look through your providers documentation.</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>If you are running on a local machine and have
just installed mySQL for the first time, you can probably leave the user name
and password empty ( i.e. = “”) until you set up a mySQL user account.</span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'> </span></p>
<div style='border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm'>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:Arial;
color:#003366'> </span></i></p>
</div>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:Arial;
color:gray'> </span></i></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'> </span></p>
<h1><span style='font-size:14.0pt;font-family:Arial;color:navy;font-weight:
normal'>Running the ezSQL demo</span></h1>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>Once you have installed ezSQL as described
above you can see it in action by running ez_demo.php via your web browser. To
do this simply go to..</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><span
style='font-size:11.0pt;font-family:Arial;color:#003366'>http://yourserver.com/install_path/mysql/demo.php</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>If you are running your web server on your
local machine this will be..</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><span
style='font-size:11.0pt;font-family:Arial;color:#003366'>http://127.0.0.1/install_path/mysql/demo.php</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>What the demo does… is use ezSQL functions to
map out the table structure of your database (i.e the database you specified at
the top of ez_sql.php). You will be surprised how little code is required to do
this when using ezSQL. I have included it here so you can get a quick feel for
the compactness and speed of ezSQL.</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'><?php</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> // Include ezSQL core</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> include_once "ez_sql_core.php";</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> // Include ezSQL database
specific component</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> include_once
"ez_sql_mysql.php";</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> // Initialise database object and
establish a connection</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> // at the same time - db_user /
db_password / db_name / db_host</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> $db = new
ezSQL_mysql('db_user','db_password','db_name','db_host');</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
$my_tables = $db->get_results("SHOW TABLES",ARRAY_N);</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
$db->debug();</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
foreach ( $my_tables as $table )</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
{</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
$db->get_results("DESC $table[0]");</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
$db->debug();</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
}</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>
</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>?></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'> </span></p>
<div style='border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm'>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:Arial;
color:#003366'> </span></i></p>
</div>
<p class=MsoNormal><i><span style='font-size:10.0pt;font-family:Arial;
color:gray'> </span></i></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'> </span></p>
<h1><span style='font-size:14.0pt;font-family:Arial;color:navy;font-weight:
normal'>The ezSQL demo explained</span></h1>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:Arial'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-size:10.0pt;
font-family:Arial;color:red'><?php</span></b></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>This is the standard way to start php
executing within your web page.</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:10.0pt;
font-family:Arial'> </span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><b><span
style='font-size:10.0pt;font-family:Arial;color:red'>include_once “ez_sql.php”;</span></b></p>
<p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>This is how you include ezSQL in your script.
Normally you include it at the top of your script and from that point forward
you have access to any ezSQL function.</span></p>
<p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-size:11.0pt;
font-family:Arial;color:#003366'> </span></b></p>
<p class=MsoNormal style='margin-left:36.0pt'><b><span style='font-size:10.0pt;
font-family:Arial;color:red'>
$my_tables = $db->get_results(“SHOW TABLES”,ARRAY_N);</span></b></p>
<p class=MsoBodyTextIndent2 style='margin-left:72.0pt'>get_results() is how you
get ‘a list’ of things from the database using ezSQL. The list is returned as
an array. In this case the std mySQL command of ‘SHOW TABLES’ is called
and the resulting list is stored in a newly created array $my_tables. </p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><span
style='font-size:10.0pt;font-family:Arial'> </span></p>
<p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>When using $db->get_results(), if there are
any results, they are always returned as multi-dimensional array. The first
dimension is a numbered index. Each of the numbered indexes is either an
object, associative array or numerical array containing all the values for ‘one
row’.</span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><b><span
style='font-size:11.0pt;font-family:Arial;color:#003366'> </span></b></p>
<p class=MsoNormal style='margin-left:72.0pt'><span style='font-size:11.0pt;
font-family:Arial;color:#003366'>For example using the switch ARRAY_A would
produce an array that looked something like this.</span></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:36.0pt'><b><span
style='font-size:11.0pt;font-family:Arial;color:#003366'> </span></b></p>