<<

. 130
( 132 .)



>>

shopping cart sorting
Apache, configuring for credit-card by any column type (order by), 73
authorization, 482“483 array by ascending or alphabetical order, 163
application scope and goals, 477“479 soundex string, 716
code classes, 486“492 space character (#), 717
credit-card processor, 486 SQL statements
data, 479“480 indenting, 196“197
encryption and security configuration, running
480“482 insert, 676“677
scripts update, 677“678
checkout, 495“504 square root, non-negative (SQRT), 705
creating cart (CART.PHP), 493“495 staff members
printing categories or specific products logging in (staff/problems.php),
(DISPLAY.PHP), 492“493 473“475
sessions, 483“485 table (fetch_staff()), 453“454
Simple Object Access Protocol. See SOAP stages, content-management system, looking up
Simplexml, 509“511 (stage(), stage_id(), stages()),
sine (SIN), 706 379“380
single record, returning (FETCH_RECORD()), 416 standard deviation of expr (STD/STDDEV), 733
site configuration, sharing information start
(book_constants()), HTML survey, form, 673
output buffering (OB_START()), 188
291
Slashdot headline, 511“512 shopping cart session (SESSION_START()),
slashes 485
adding to insert and update queries in state name function, 670
strings (ADDSLASHES()), 138 statement used to create table, 47“48
Index 757

status transforming into array (EXPLODE()),
file, 625“626 150“151
information commands, 587“590 type of variable, returning as (GETTYPE()),
MySQL, 589 153
problem-tracking system, tracking URL functions, encoding (urlencode()),
(status_change()), 462“464 185
project, viewing, 548“552 variable functions, testing (is_array(),
table, 47 is_numeric(), and is_string()),
tasks within projects, 542 148
stopping sessions (SESSION_DESTROY()) zero-length, 24
stored procedures, 21“22 string functions
storing, handlers ASCII-code value, 709
(SESSION_SET_SAVE_HANDLER()), character count (STRLEN()), 140
shopping cart session, 485 comparison
story, content-management system full string (STRCMP), 699
finding by author (function full-text searching (MATCH...AGAINST),
fetch_author()), 378 699
record, getting (fetch_story()), 375“376 string expression, matching against
table of, creating or updating regular expression (REGEXP and NOT
(write_story()), 382“387 REGEXP), 698
version, getting (fetch_story_version()), wildcard characters, pattern matching
376“378 (LIKE and NOT LIKE), 697
stream, image, 182 concatenation of arguments (CONCAT),
string 711“712
argument, value writing to file (FWRITE()), conversion
172 capitalization (STRTOLOWER(),
array elements, concatenating (JOIN()), 154 STRTOUPPER(), UCFIRST(), and
array, turning into (IMPLODE()), 151 UCWORDS()), 141
cleaning up for use as HTML tag character order, reversing (REVERSE), 717
(make_page_title()), 670 from, replacing with to (REPLACE), 716
connection, content-management system, HTML break, adding after each newline
362“365 (NL2BR()), 141“142
date, 36 HTML escape codes, translating
delimiting, PHP scripts, 94“96 characters into (HTMLENTITIES()
encrypting for Unix, 731“732 and HTMLSPECIALCHARS()), 139
formatting according to C-style pattern lower case, changing characters to
(SPRINTF()), 166 (LCASE), 718
match, testing for (ereg()), 143“144 numbers, converting bases (CONV), 710
for matches to a pattern replacing arguments (STR_REPLACE()),
(PREG_MATCH_ALL()), 148 140
MD5 checksum, calculating, 732 reversing (STRREV()), 141
one-way hash, returning (CRYPT()), 139 hexadecimal value (HEX), 711
password, encrypting and decrypting, 732 HTML and PHP tags, removing
Perl regular expression string, transforming (STRIP_TAGS()), 137“138
into array (PREG_SPLIT()), 152“153 index (FIELD), 718
regular expression, transforming into array input, concatenating (STR_REPEAT()),
(SPLIT()), 151“152 139“140
replacing based on complex patterns INSERT, 717
(EREG_REPLACE()), 144“145 continued
758 Index

string functions continued subtitles, HTML element, 672
integers, ASCII-code values of (CHAR), 711 sum of given column, returning (sum()
leading and trailing spaces, removed (TRIM), function), 77“78
715“716 Sunday, week beginning (DAYOFWEEK), 719“720
leading spaces, removed (LTRIM), 715 superset, text values (set), 32“33
leftmost len characters (LEFT), 713“714 survey application
left-padded (LPAD), 713 claim code, checking (claim.php), 304“308
len characters long (SUBSTRING), 714 code overview, 270“273, 274“276
length, 712 database design, 266“270
manipulation, 610“614 described, 294“298
measuring (ELT), 718 HTML functions
octal value (OCT), 710 arguments, handling, 276“281
one-way hash of string, returning character separating directory names
(CRYPT()), 139 (path_separator()), 292
position checkbox, default status, 290“291
of last occurrence of search character directory, adding to default path
(STRRPOS()), 140“141 (ADD_TO_INCLUDE_PATH()), 292“293
LOCATE, 712“713 initialization code, 293“294
STRPOS(), 140 site configuration, sharing information
of substring (INSTR), 713 (book_constants()), 291
repeating certain number of times (REPEAT), tags, creating common (FROM
717 /BOOK/FUNCTIONS/HTML/), 281“289
returning as binary value (BIN), 710 text field, printing, 289“290
rightmost len characters (RIGHT), 714 questions, adding, editing and deleting
right-padded (RPAD), 713 (admin/questions.php), 298“303
slashes, 138“139 random winner, drawing
soundex string, 716 (admin/get_winner.php), 303
space characters (#), 717 scope and goals, 261“266
specially-formatted ASCII string (ORD), 709 winner, notifying (admin/winners.php),
STRCHR() and STRSTR(), 140 303“304
substring, returning (SUBSTR()), 141 system requirements, back-of-the-book CD, 557
SUBSTRING_INDEX, 714“715
T
text, image (GETIMAGESIZE()), 181
trailing-space characters, removed (RTRIM), table
715 BerkeleyDB, 40“41
upper case, changing characters to (UCASE), catalog
719 inherited classes (LEGAL_VALUES()),
white spaces, trimming (TRIM()), 139 420“421
style, catalog query for later-named
class, 433“434 (FETCH_SIMPLE_QUERY()), 415
inserting (MAP_STYLE()), 429 columns
printing, 436“437 adding, 42
submit field, form, 674 definitions, changing, 43“44
subpattern, 147 dropping, 43
subqueries, correlated, 86“87 types, 29“37
subset of columns, grouping (group by content-management system
options), 79“80 authors (write_author()), 381“382
substring building for workflow stages
position (INSTR), 713 (stage_table_name()), 380“381
returning (SUBSTR()), 141 of stories, creating or updating
SUBSTRING_INDEX, 714“715 (write_story()), 382“387
Index 759

creating, 26“29, 47“48 updating data, 55“59
data storage, simple and problematic, 6 user, 599“600
default working, defining (use command), 27 username and password, verifying against
deleting data, 59“61 (authenticate()), 669
described, 600“601 viewing, 45
eliminating duplicate data (distinct table structure (first normal form), 10“11
clause), 70 tags
Flush, 591 creating common for HTML survey (FROM
group by and aggregate functions, 74“80 /BOOK/FUNCTIONS/HTML/), 281“289
Heap, 41 HTML and PHP, removing
HTML tags (cleanup_text()), 669
cell, 673 Netscape references, 696
closing, 672 string, cleaning up for use as HTML
row, 672“673 (make_page_title()), 670
table inside paragraph title (MAKE_PAGE_TITLE()), 240
(start_table()), 672 tangent (TAN), 706
indexes tasks
adding, 43 project management database, 543
creating, 37“38 status, project management database, 542
dropping, 43 terminating
InnoDB, 40“41 command (G), 176
inserting data, 53“55 script after outputting argument string
interfaces, 23 (die()), 176
joining, 80“87 testing
MyISAM, 39“40 for array (is_array()), 113
name for Boolean (is_bool()), 113“114
changing, 41“42 end of file (FEOF()), 172
returning result (FETCH_SIMPLE()), for existence
415“416 of directory (IS_DIR()), 174
null values, 24“25 of file (FILE_EXISTS()), 173
query, laying out in (select_to_table()), of script control functions
679 (function_exists()), 177
replacing data, 61“64 for floating-point or double number
retrieving values (is_double()), 113
with predicate (in/not in), 71“72 for NULL value (nullop()), 373“374
within a range (between), 70“71 for object (is_object()), 114
select statement, 64“67 for resource (is_resource()), 114
with wildcard characters (like clause), 72 for text string (is_string()), 113
rows for type of variable (gettype()), 114
restricting number returned (limit for type other than array, object, or resource
parameter), 73 (is_scalar()), 114
retrieving limited (where clause), 67“70 variable functions for type (is_array(),
returned, restricting number (limit), 73 is_numeric(), and is_string()),
specifying order returned (order by 148
command), 73 variables
selecting values (db_fetch_record()), 670 for empty setting, 112“113
separating into multiple new, 5 for integer (is_int()), 113
SQL, deleting from (delete_row()), 678 for NULL, 113
staff (fetch_staff()), 453“454 value, finding (isset()), 112
status (show command), 47 whether values identical, 119
760 Index

text threads, viewing active, 589“590
buttons, 569 thumbnails images, 183, 430
form, 673 time, current (CURTIME), 729
HTTP, blocking further headers timeout lock, 732“733
(header_sent()), 180 timestamp, UNIX, 729“730
manipulating with user-defined functions, title, Guestbook 2003 tags
669“670 (MAKE_PAGE_TITLE()), 240
testing contents, 119“121 to, replacing from in string (REPLACE), 716
text box, form (textarea_field()), 673“674 token replacement, 369
text entry, HTML form input (textarea), topic, information about given topic, displaying
566“567 (display_topic()) threaded discussion,
text field 326“329
form, 674 tracking error responses, 333“336
printing, HTML survey, 289“290 transaction, 20“21, 421“422
text file, address book, creating, 4 translating, escape code characters into HTML
text string (HTMLENTITIES() and
image function (GETIMAGESIZE()), 181 HTMLSPECIALCHARS()), 139
storing tree structure, 488“490
char, 30 trimming white space, 139
described, 29 triple equals sign (===), 93
large strings and binary objects troubleshooting, CD, back-of-the-book, 560
(tinytext/tinyblob, text/blob, true or false
if statement, 118“122
mediumtext/mediumblob,
longtext), 31“32 variable functions (isset()), 148
limited potential values (enum), 32 whether key exists in array
values, defined superset (set), 32“33 (ARRAY_KEY_EXISTS()), 158
varchar, 30 truncating to D decimals (TRUNCATE), 704
testing for (is_string()), 113 turning off, output buffering (OB_END_CLEAN(),
third normal form, 13“14 OB_END_FLUSH()), 188
threaded discussion two-digit year format (year[(2|4)]), date and
application scope and goals, 312“316 time columns, 37
code, main functions, 320“321 two-dimensional arrays, assigning, PHP
data, 316“320 scripts, 99
described, 311“312 type
error-handling and debugging image, checking (EXIF_IMAGETYPE()), 183
constant, defining to use in bitmask image function (GETIMAGESIZE()), 181
(get_constant()), 345“347 of variable
described, 332“333 returning as string (GETTYPE()), 153
function, calling when error occurs setting, 634“635
(error_handler()), 337“345 testing (is_array(), is_numeric(),
level displayed and logged, 333 and is_string(), gettype()),
simplifying (push_handler() and 114, 148
pop_handler()), 337 type-conversion functions
tracking responses to types, 333“336 array
form data, inserting into database creating and populating with elements
(create_topic()), 329“332 (RANGE()), 154
function displayed and described turning into string (IMPLODE()), 151
(display_kids()), 321“326 array elements
information about given topic, displaying concatenating in a string (JOIN()), 154
(display_topic()), 326“329 converting into variables (COMPACT()),
reusable functions, 321 153
Index 761

case-insensitive pattern match (split()), updating
155 catalog record (UPDATE_RECORD()), 419
comparing variables, 92“93 content-management system
described, 149“150 authors table (write_author()),
floating-point numbers, converting to 381“382
formatted string (NUMBER_FORMAT()), stories table (write_story()),
154 382“387
key/value pairs, pulling from array and data in tables, 55“59
making into standalone variables problem-tracking system
(EXTRACT()), 153“154 individual entries (history_entry()),
Perl regular expression string, transforming 459“461
into array (PREG_SPLIT()), 152“153 script (problem.php), 464“465
regular expression string, transforming into uploaded file
array (SPLIT()), 151“152 check and then move
scalar variable, returning as integer or (MOVE_UPLOADED_FILE()), 175
floating-point variable (INTVAL() and HTTP, checking (IS_UPLOADED_FILE()),
FLOATVAL()), 153 174
setting to specified (SETTYPE()), 153 uploading files
string, transforming into array (EXPLODE()), to catalog, 409“410
150“151 project management, 545, 552
type of variable, returning as string uppercase
(GETTYPE()), 153 letters, changing (STRTOLOWER(),
STRTOUPPER(), UCFIRST(), and
U UCWORDS()), 141
string, changing (STRTOLOWER(),
unencoding non-alphanumeric characters in
STRTOUPPER(), UCFIRST(), and
URL functions (rawurldecode()), 185
UCWORDS()), 141
Uniform Resource Locator. See URL

<<

. 130
( 132 .)



>>