<<

. 126
( 132 .)



>>

BEGIN(), COMMIT(), and ROLLBACK(),
counting string (STRLEN()), 140
422
decimals, storing as, 35
inherited (LEGAL_VALUES()), 420“421
escape sequences, 54
values, saving (WRITE_TO_DB()), 420
escaping string, 94
data, 403“407
HTML 4.0 entity references, 696
deleting record (DELETE_FROM_DB()), 417
matching to series of known patterns,
described, 397, 411“412
659“660
empty properties, leaving out
non-alphanumeric, 185
(DATA_FIELDS()), 418
order, reversing, 717
file system, accessing, 408
position of last occurrence in string
ID value, getting record by
(STRRPOS()), 140“141
(FETCH_FROM_DB()), 416“417
regular expressions, 660“661
image, extending, 432“433
separating directory names
list of fields (FIELDLIST()), 417“418
(path_separator()), HTML survey, 292
matching field value, getting all
character classes, 661“663
(FETCH_ALL()), 417
character-set, 238“239
multi-statement transaction
checkbox
(TRANSACTION()), 421“422
default status, 290“291
new objects, instantiating (__CONSTRUCT()),
form, 675
413
multiple before pressing Submit button, 104
738 Index

checking and moving uploaded file described, 486
(MOVE_UPLOADED_FILE()), 175 orders, 491“492
checkout, shopping cart, 495“504 requests, 487“488
child products, catalog, printing, 437“439 class functions
children, listing, catalog products class, 423“424 described, 163“164
claim code, survey winner, checking determining (is_a()), 164
(claim.php), 304“308 method, whether defined
class (method_exists()), 164
abstract, 212“215 name, returning (get_class()), 164
catalog cleaning up
Base, 412“413 output buffering (FLUSH()), 188
BEGIN(), COMMIT(), and ROLLBACK(), string for use as HTML tag
422 (make_page_title()), 670
deleting record (DELETE_FROM_DB()), 417 text, reversing (REVERSE_CLEANUP_TEXT()),
described, 411“412 239“240
empty properties, leaving out client file, Barnes & Noble application, 529“531
(DATA_FIELDS()), 418 cloning, 218“219
ID value, getting record by closing tag, 561“562, 672
(FETCH_FROM_DB()), 416“417 Codd, E.F. (relational database inventor), 3
inherited (LEGAL_VALUES()), 420“421 code
list of fields (FIELDLIST()), 417“418 blocks, indenting, 192“194
matching field value, getting all catalog
(FETCH_ALL()), 417 file system, accessing, 408
multi-statement transaction files, uploading, 409“410
(TRANSACTION()), 421“422 object-oriented approach, 408
new objects, instantiating comments, 221“224
(__CONSTRUCT()), 413 content-management system, 361“362
new record, creating external files, including, 197“200
(CREATE_RECORD()), 419 Guestbook 2003, 235“236
property values, setting (BUILD()), 414 HTML survey initialization, 293“294
query for later-named table indenting, 191“197
(FETCH_SIMPLE_QUERY()), 415 object-oriented programming, 209“220
single record, returning problem-tracking system, 452
(FETCH_RECORD()), 416 procedural versus object-oriented code,
static variables, using in methods 220“221
(DBH()), 413“414 project management
table name, returning result active projects, showing, 544“545
(FETCH_SIMPLE()), 415“416 authentication, 546“548
updating record (UPDATE_RECORD()), file contents, displaying, 553
419 logging in and establishing
values, saving them (WRITE_TO_DB()), session, 544
420 new project, creating, 545
described, 210 projects™ status, viewing, 548“552
determining (is_a()), 164 session management, 545“546
inheritance, 215“218 uploading files, 545, 552
interfaces, 211“212 user, adding, 545
shopping cart viewing files, 545
Address table, 490“491 stored in variable, executing (eval()), 176
database record tree structure, 488“490 survey, 270“273, 274“276
Index 739

threaded discussion, main functions, content-management system
320“321 administrator functions (content/admin/
user-defined functions, 200“208 user.php), 389“392
code class. See class application scope and goals, 350“353
column author, finding all stories by (function
date and time, 35“37 fetch_author()), 378
definitions, changing, 43“44 authors table, creating or updating records
dependencies, 11 (write_author()), 381“382
dropping, 43 code overview, 361“362
excessive use of, 19 connection string, 362“365
indexes, creating, 37“38 customization, need for, 349“350
numeric, 33“35 database design, 355“361
sum of given, returning (sum() function), editorial review (content/story.php),
77“78 392“394
table, adding, 42 error handling (db_error_handler()),
text strings, 29“33 368“369
viewing, 46 NULL value, checking for (nullop()),
command, terminating (G), 176 373“374
command-line interface (mysql), 583“586 persistent connection, creating
commands, bundle. See transaction (db_connect()), 365“368
comments, code, organized and readable, query, shorthand (db_values_array()),
221“224 372“373
COMMIT(), catalog classes, 422 records, getting (db_fetch_record()),
common elements, array functions 369“372
(ARRAY_INTERSECT()), 159 security, 353“355
comparison operators, 69, 122 stages, looking up (stage(), stage_id(),
complex data types, SOAP (Simple Object stages()), 379“380
Access Protocol), 523“524 stories table, creating or updating records
complex if statement, 123“124 (write_story()), 382“387
concatenating story record, getting (fetch_story()),
arguments (CONCAT), 711“712 375“376
array elements in a string (JOIN()), 154 table, building for workflow stages
arrays (ARRAY_MERGE()), 156 (stage_table_name()), 380“381
string input (STR_REPEAT()), 139“140 user and password validation
conditions, checking, 125“127 (connect_validate_login()),
configuration 374“375
option (ini_get()), 189 user authentication
PHP, 580“581 (content/authenticate.php),
value, assigning (ini_set()), 189 387“389
connection user postings, finding all (fetch_user()),
database, 670 378“379
persistent, 365“368 version of story, getting
string, 362“365 (fetch_story_version()), 376“378
constant continue loop, 131“132
defining to use in bitmask control characters, 186
(get_constant()), 345“347 converting
Guestbook 2003 (FROM array elements into variables (COMPACT()),
/GUESTBOOK2K/GLOBALS.PHP), 241“242 153
value of defined, 149 current time to seconds (SEC_TO_TIME), 730
constructor, 213“214, 422“423 continued
740 Index

converting continued replacing in tables, 61“64
floating-point numbers to formatted string retrieving from tables (select), 64“67
(NUMBER_FORMAT()), 154 shopping cart, 479“480
type when comparing variables, 92“93 simple table, 6
cookie threaded discussion, 316“320
browser-passed variables, accessing, 104“106 tracking updates (history_entry()),
HTTP header, setting (setcookie()), 180 459“461
copy, joining tables to itself (self), 85“86 updating tables, 55“59
copying Data Definition Language. See DDL
files (COPY()), 173“174 data stream, thumbnails, retrieving as
part of image (IMAGECOPYRESIZED()), (EXIF_THUMBNAIL()), 183
181“182 database
cosine (COS), 706 call, putting together (SELECT_ENTRIES()),
cotangent (COT), 707 253“254
counting defining default working (use command), 27
array functions (ARRAY_COUNT()), 157“158 design
characters in string (STRLEN()), 140 anomalies, 5“10
number of rows in each group (count() content-management system, 355“361
function), 74“77 Guestbook 2003, 234“235
repeating string certain number of times normalization, 10“14
(REPEAT), 717 problem-tracking system, 444“452
credit-card processor, shopping cart, 486 project management, 541“544
C-style pattern string, formatting (SPRINTF()), referential integrity, 19“20
166 relational databases, benefits of, 3“5
CURL function, 641 relationships, 15“19
current date and time (NOW), 729 stored procedures, 21“22
current date (CURDATE), 729 survey, 266“270
current time, 169, 729, 730 transactions, 20“21
cursor array, resetting (RESET()), 162 examining (show command), 44“48
customer form data, inserting for threaded discussion
ID, finding by (fetch_customer()), (create_topic()), 329“332
454“455 functions, user-defined, 670“671
identifying by phone number or email GUI tools, 48“52
address (find_customer()), 457“459 name, current, 730
response in (write_customer.php), record tree structure, 488“490
466“473 table
sending email (notify_customer()), creating, 26“27
461“462 user administration, 600“601
CyberCash function, 643 username and password, verifying
against (authenticate()), 669
D variable format (SESSION_ENCODE()), 485
date and time
daemon, MySQL, checking for alive and
calculations
running, 588
arithmetic (DATE_ADD), 723“725
data
day from specified year (FROM_DAYS), 726
catalog, 403“407
difference of months in period
complex types, SOAP, 523“524
(PERIOD_DIFF), 723
deleting from tables, 59“61
months, adding to period (PERIOD_ADD),
eliminating duplicate from tables (distinct
722“723
clause), 70
valid dates (MKTIME()), 168“169
inserting into tables, 53“55
Index 741

changes, recording most recent decimals
(timestamp), 36 rounding to integer with specified number
current, 169, 729 (ROUND), 704
date, current (CURDATE), 729 storing as characters (decimal), 35
day number (TO_DAYS), 726 truncating to D (TRUNCATE), 704
day of the month, 720 declaring variables, PHP scripts, 91“93
day of year, 720 decomposition, 5
described, 620 decrypting password, 732
format default path, adding to directory
current time as seconds (TIME_TO_SEC), (ADD_TO_INCLUDE_PATH()), 292“293
730 defined constants, 149
full name of month, 721 defining, variable with specified name and
full name of weekday (DAYNAME), 721 value (define()), 149
hour, 722 definitions, column, changing, 43“44
hour, minute, second (time), 37 degrees
setting (DATE_FORMAT), 726“728 radians, converting segment to (RADIANS),
two-digit year (year[(2|4)]), 37 709
week beginning with Monday index segment, converting from radian (DEGREES),
(WEEKDAY), 720 708
week beginning with Sunday index delete anomaly, 8, 9
(DAYOFWEEK), 719“720 deleting
week of year (YEARWEEK), 722 all path elements but base (BASENAME()),
year, 722 175
year, month, day, 36 from arrays
year, month, day, time, 36 first element (ARRAY_SHIFT()), 160
insert statements, 35 last element from array (ARRAY_POP()),
interpretation, 35 160
location in manual, 170 catalog records (DELETE_FROM_DB()), 417
minute, 722 control characters from URL functions
month, 720 (base64_encode()), 186
PHP scripts, 166“170 Guestbook 2003 entries, 257“258
quarter of year, 721 highest value (max() function), 78
returning (DATE()), 166“168 HTML and PHP tags (cleanup_text()), 669
second, 722 leading and trailing spaces (TRIM), 715“716
seconds, converting to (SEC_TO_TIME), 730 lowest value (min() function), 78
seconds since Unix Epoch (MICROTIME()), slashes from insert and update queries
169“170 (STRIPSLASHES()), 138“139
since UNIX time, 730 specific elements (ARRAY_SPLICE()),
UNIX timestamp, 729“730 156“157
week, 721 from strings
DDL (Data Definition Language), 23 HTML and PHP tags (STRIP_TAGS()),
debugging 137“138
constant, defining to use in bitmask leading spaces (LTRIM), 715
(get_constant()), 345“347 trailing-space characters (RTRIM), 715
described, 332“333 survey questions (admin/questions.php),
function, calling when error occurs 298“303
(error_handler()), 337“345 from tables
level displayed and logged, 333 data, 59“61
simplifying (push_handler() and duplicate data (distinct clause), 70
pop_handler()), 337 in SQL (delete_row()), 678
tracking responses to types, 333“336 dependencies, 11, 13“14
742 Index

descriptions of object. See properties element
destructors, described, 219 adding to beginning (ARRAY_UNSHIFT()),
deviation, standard of expr (STD/STDDEV), 733 160
differences array, creating and populating with
array functions (ARRAY_DIFF()), 159 (RANGE()), 154
of months in period (PERIOD_DIFF), 723 first, return and remove (ARRAY_SHIFT()),
dimensions, image, 182 160
directory passing through function (ARRAY_WALK()),
adding to default path 161
(ADD_TO_INCLUDE_PATH()), 292“293 path, cutting off all but base (BASENAME()),
creating (MKDIR()), 174 175

<<

. 126
( 132 .)



>>