<<

. 129
( 132 .)



>>

of last occurrence of search character in database design, 444“452
string (STRPOS()), 140“141 described, 441“442
of string (LOCATE, STRPOS()), 712“713 email, sending to customer
of substring (INSTR), 713 (notify_customer()), 461“462
positive number (SIGN), 702 necessary elements, 442“444
postings, finding users™ (fetch_user()), problem and related information
378“379 (fetch_problem()), 455“456
predicate values, retrieving with (in/not in), scripts
71“72 customer response
preventative measures. See security (write_customer.php), 466“473
price, catalog products class, 423 enter or updating problem
primary keys (problem.php), 464“465
defined, 10, 11 form (problem_entry_form.php),
index, creating, 37“38 465“466
multi-column (second normal form), 11“13 staff members, logging in
repeating groups of data versus, 14 (staff/problems.php), 473“475
replace statement, 61“63 staff table (fetch_staff()), 453“454
print functions status, tracking (status_change()),
basic (PRINT()), 165 462“464
described, 164“165 updates, entering (history_entry()),
language construct (ECHO()), 165 459“461
string, formatting according to C-style procedural code, 21“22, 220“221
pattern (SPRINTF()), 166 process, ending, 590
variable products
contents of (VAR_DUMP()), 166 catalog records
printing entire contents to screen constructor (__CONSTRUCT()), 422“423
(PRINT_R()), 166 ID value of new image (UPLOAD()), 430
printing image matching display (THUMBNAIL()),
catalog 430
child products, 437“439 images (IMG()), 429“430
product, 435“436 LIST_ALL_CHILDREN() and
styles, 436“437 LIST_CHILDREN(), 423“424
Guestbook 2003 library mappings, retrieving
arguments (PRINT_INPUT_FIELDS()), (LIST_MAPPED_STYLES()), 426“428
249“250 notes, adding (ADD_NOTES()), 424“425
query (PRINT_ENTRY()), 248“249 overloading methods (__GET() and
HTML survey text field, 289“290 __CALL()), 430“431
shopping cart categories or products PRICE(), 423
(DISPLAY.PHP), 492“493 record, saving (WRITE_TO_DB()),
private-key encryption, 481 428“429
Index 753

style, inserting (MAP_STYLE()), 429 questions, survey, 298“303
unmapped root-level styles, retrieving quotation marks, magic, 581
(LIST_UNMAPPED_STYLES()), 425
R
printing
catalog, 435“436 radians
list in shopping cart (DISPLAY.PHP), degrees, converting segment from, 709
492“493 segment, converting to degrees, 708
project management radio button, 675
application goals, 537“541 raising to power of Y (POW), 705
code random array elements
active projects, showing, 544“545 creating (SHUFFLE()), 163
authentication, 546“548 picking (ARRAY_RAND()), 162“163
file contents, displaying, 553 random floating-point value (RAND), 707
logging in and establishing session, 544 random number generator, 177“178, 632
new project, creating, 545 random winner, drawing (admin/
projects™ status, viewing, 548“552 get_winner.php), 303
session management, 545“546 range, retrieving values within (between),
uploading files, 545, 552 70“71
user, adding, 545 reading
viewing files, 545 file line by line (FILE()), 173
database design from file pointer to specified number of
application users, 542 bytes or to the end (FREAD()), 172
described, 541 record
files, 543“544 catalog
mapping to users, 543 classes, updating (UPDATE_RECORD()),
projects, 542 419
status, 542 creating (CREATE_RECORD()), 419
tasks, 543 deleting (DELETE_FROM_DB()), 417
user types, 541“542 getting by ID value (FETCH_FROM_DB()),
properties 416“417
array of (get_object_vars()), 164 returning single (FETCH_RECORD()), 416
defined, 209 saving (WRITE_TO_DB()), 428“429
empty, leaving out (DATA_FIELDS()), 418 content-management system
value, setting in catalog classes (BUILD()), getting (db_fetch_record()), 369“372
414 story (fetch_story()), 375“376
protocol, encryption and security, 482 shopping cart tree structure, 488“490
public-key encryption, 481 recording most recent changes in date and time
columns (timestamp), 36
Q referential integrity, 19“20
query regular expression
common, dealing with, 676“680 character classes, 661“663
for later-named table characters, 660“661
(FETCH_SIMPLE_QUERY()), 415 described, 659
laying out in table (select_to_table()), example, 665“667
679 functions
printing (PRINT_ENTRY()), 248“249 altering to use in case-insensitive
returning in one result set (union), 86 expressions (sql_regcase()),
shorthand (db_values_array()), 372“373 145“146
writing safely (SAFE_MYSQL_QUERY()), described, 142“143, 633
243“244 continued
754 Index

regular expression continued retrieving
match, testing string (ereg()), 143“144 handlers (SESSION_SET_SAVE_HANDLER()),
PCRE, 146“148, 633“634 485
string, replacing based on complex limited rows (where clause) from table,
patterns (EREG_REPLACE()), 144“145 67“70
multiple occurrences, 663“665 mappings, catalog products
patterns, matching to series of known (LIST_MAPPED_STYLES()), 426“428
characters (literal patterns), 659“660 table data (select), 64“67
Perl string, transforming into array unmapped root-level styles, catalog
(PREG_SPLIT()), 152“153 products (LIST_UNMAPPED_STYLES()),
specifying “or”, 665 425
string expression, matching (REGEXP and values
NOT REGEXP), 698 with predicate (in/not in), 71“72
string, transforming into array (SPLIT()), within a range (between), 70“71
151“152 with wildcard characters (like
relational databases, benefits of, 3“5 clause), 72
relationships, database design return values
many-to-many, 17“19 generated by called function, in original
one-to-many, 15“16 order (ARRAY_MAP()), 158“159
one-to-one, 16“17 PHP functions, 135“136
reloading user grants, 605 user-defined functions, 203“205
remainder of # divided by M (MOD), 703 reusable functions, 321
removing. See deleting reversing
repeating string, 717 character order (REVERSE), 717
replacing string (STRREV()), 141
arguments in strings (STR_REPLACE()), 140 text cleanup (REVERSE_CLEANUP_TEXT()),
non-alphanumeric characters in URL Guestbook 2003, 239“240
functions (rawurlencode()), 185 revoke statement, user privileges, 602, 604
PCRE (PREG_REPLACE()), 147 rightmost len characters (RIGHT), 714
string based on complex patterns right-padded string (RPAD), 713
(PREG_REPLACE()), 144“145 rights, granting to users, 597“598
table data, 61“64 ROLLBACK() catalog classes, 422
reporting level, error functions rounding
(error_reporting()), 186 floating-point (floor()) variable functions,
request 149
shopping cart code, 487“488 to integer and specified number of decimal
SOAP, 522“523 places (ROUND), 704
required files, 199 row
reset form, 675 counting number in each group (count()
resource function), 74“77
testing for (is_resource()), 114 grouped, restricting (having predicate), 80
type other than, testing for (is_scalar()), HTML tags, 672“673
114 restricting number returned (limit
response parameter), 73
SOAP, 523 retrieving limited (where clause) from table,
tracking, 333“336 67“70
restricting specifying order returned (order by
grouped rows (having predicate), 80 command), 73
number of rows returned (limit), 73 Runtime Labs, 50
Index 755


S seconds
converting time to (SEC_TO_TIME), 730
SAPI (Server Application Programming
formatting current time (TIME_TO_SEC), 730
Interface), 189
since Unix Epoch (MICROTIME()), 169“170
saving
security
catalog class values (WRITE_TO_DB()), 420
catalog, determining, 402“403
record (WRITE_TODB()), catalog products
certificates, 481“482
class, 428“429
content-management system, 353“355
scalar variable, returning as integer or
described, 480“481
floating-point variable (INTVAL() and
global variables, problems with, 101
FLOATVAL()), 153
malicious text, barring (CLEANUP_TEXT()),
screen, variable, printing entire contents
239
(PRINT_R()), 166
password, 235, 732
script
problem-tracking system, 444
control functions
public-key/private-key, 481
argument string, outputting and then
reversing text cleanup
terminating script (die()), 176
(REVERSE_CLEANUP_TEXT()), 239“240
code stored in variable, executing
secure protocol, 482
(eval()), 176
shopping cart, 479
function™s arguments, obtaining
survey application, 265“266
information (func_get_arg(),
threaded discussion, 314“315
func_get_args(), and
tools, 482
func_num_args()), 176“177
seeding random number generator
language constructs (include(),
(mt_srand()), 178
include_once(), require(), and
segment
require_once()), 177
degrees, converting to radians (RADIANS),
testing for existence
709
(function_exists()), 177
radians, converting to degrees (DEGREES),
user-defined function, 176
708
Guestbook 2003, 259
select
problem-tracking system
form field, 675
customer response
HTML form input, 565“566
(write_customer.php), 466“473
query, testing, 124
enter or updating problem
selecting database values
(problem.php), 464“465
(db_fetch_record()), 670
form (problem_entry_form.php),
self join tables, 85“86
465“466
self-made character classes, 662“663
staff members, logging in
sending
(staff/problems.php), 473“475
email to customer (notify_customer()),
sample catalog, 434“439
461“462
shopping cart
error message (trigger_error() and
checkout, 495“504
user_error()), 187
creating cart (CART.PHP), 493“495
server
list of categories or specific products,
application, writing, 534“535
printing (DISPLAY.PHP), 492“493
availability on, 44“45
terminating after outputting argument
HTTP, communicating with (header()),
string (die()), 176
179“180
searching, full-text, string comparison
version, finding, 731
functions (MATCH...AGAINST), 699
Server Application Programming Interface.
second normal form, 11“13
See SAPI
756 Index

service call, 526“527 insert and update queries, adding to
session (ADDSLASHES()), 138
browser-passed variables, accessing, removing from insert and update queries
106“107 (STRIPSLASHES()), 138“139
establishing, 544 Sleepycat software, 41
functions, 635“637 smallest argument (LEAST), 707“708
handling, user-defined functions, 680“682 smallest integer value not greater than X
PHP functions, 179 (CEILING), 703
project management code, 545“546 SOAP (Simple Object Access Protocol)
settings, changing, 582 body, 521“522
shopping cart complex data types, 523“524
database variable format described, 519
(SESSION_ENCODE()), 485 envelope, 520“521
described, 483 NuSOAP
handlers, storing, retrieving, application goals, determining, 527“528
and writing custom Babelfish application, 532“534
(SESSION_SET_SAVE_HANDLER()), Barnes & Noble application, 528“531
485 described, 524“526
killing (SESSION_DESTROY()), 485 server application, writing, 534“535
PHP variables, creating service call, sample, 526“527
(SESSION_DECODE()), 485 request, 522“523
start (SESSION_START()), 485 response, 523
sharing information (book_constants()), 291 socket domain connection (fsock), 627

<<

. 129
( 132 .)



>>