, 112, 184–185 LIKE, 318 LIMIT, 316, 335, 362, 363 line length, 34 Linux, 239 list tag, 112 Listen 80, Listen 8080, listItem(), 196 literal values, 253–254 Literal Values Syntax, 318 LOAD DATA, 295 loadContent(), 139, 140 local variables encapsulation, 161 functions, 129 scope, 119–120 localhost, 82, 241, 264, 269 LoggedIn, 451 $logged_in, 444 LoggedOut, 451 logical operators, 97–100 logical variables, 73–74 logIn(), 413 login, 412 logins See user logins logOut(), 416 LONGBLOB, 276–277 LONGTEXT, 276 loops, 107–118 for, 110–112 break, 114–115 continue, 114–115 do/while, 109 foreach, 112–114 infi nite, 108 parameters, 128 while, 107–109, 265, 270, 319 loosely typed language, 206 M Mac OS X Apache, cookies, 82 htdocs, 12 MySQL, 239 php.ini, 58 wphp24, 82 XAMPP, 6–8, 24 magic methods, 187, 199 magic_quotes_gpc, 300 maintenance pages, 422 many-to-many relationships, 230 MD5, 400 md5(), 400 MEDIUMBLOB, 276–277 MEDIUMINT, 277 MEDIUMTEXT, 276 menu adding to website, 444–445 addRecord(), 448 473 www.it-ebooks.info bindex.indd 473 10/3/2011 12:47:00 PM Tarr bindex.indd V2 - 09/23/2011 Page 474 $message – numbers databases, 443–460 tables, 443–444 deleteRecord(), 449, 458 editRecord(), 448 links, 443–444 index.php, 459 title, 443 _verifyInput(), 447 $message, 302, 303 method, 142 methods, 169, 180 arguments, 180–181 best practices, 180 classes, 162, 169–173, 420– 422 comments, 171 functions, 169 getter, 190, 191 mysqli, 266 PDO, 270 properties, 169, 180 public, 191 return, 171 scope, 169, 191 setter, 190, 191 static, 197–199 values, 178 variables, 169 method=”get”, 80 method=”post”, 81 mktime(), 79 Model-View-Controller (MVC), 161 mouseovers, 422 multi-dimensional arrays, 71, 73 multiple, 143 multiple tables, 331–341 JOIN, 332–335 MySQL, 331–341 subqueries, 335–336 MVC See Model-View-Controller myid, id, 315 MyISAM, 282 MySQL, 60, 239–262 Apache web server, 239 auto_increment, 245, 279–280 backup, 250–253 business rules, 231 changing data, 343–360 comments, 255 comparison operators, 318 CURRENT_TIMESTAMP, 425 data entry, 248–250, 295–311 PHP forms, 302–304 Data fieldset, 252 data selection, 314–319 data types, 228, 275–279 date/time, 278 default values, 280 deleting data, 361–386 errors, 264 escapes, 254, 295–296 Export fieldset, 251 floating-point numbers, 278 identifiers, 254 indexes, 228 integers, 277 literal values, 253–254 localhost, 264, 269 multiple tables, 331–341 NULL, 280 numbers, 277–278 passwords, 9, 389–390 PDO, 269–271 PHP, 241, 263–274, 297–302 statements, 263 phpMyAdmin, 239–253 Reference Manual, 462 restore, 250–253 security, 387–396 best practices, 389–391 sanitation fi lters, 391–393 SELECT, 314–317 strings, 253, 275–277 syntax, 253–255 tables, 275–294, 331–341 UPDATE, 344–347 WHERE, 317–318 XAMPP, 5, mysql, 263–268 mysqli, 263–268 changing data, 348–350 global variables, 268 mysqli->affected_rows, 365 mysqli->affected_rows, 365 mysqli_fetch_all($result, MYSQLI_ASSOC), 321 mysqli_fetch_all($result, MYSQLI_BOTH), 321 mysqli_fetch_all($result, MYSQLI_NUM), 321 mysqli_fetch_ array($result, MYSQLI_ ASSOC), 321 mysqli_fetch_ array($result, MYSQLI_ BOTH), 321 mysqli_fetch_ array($result, MYSQLI_ NUM), 321 mysqli::query(), 346 mysqli::real_escape_string, 299, 300, 391 mysqli::real_escape_ string(), 393 mysqli_real_escape_ string(), 393 mysqli_result, 263, 265 mysql_real_escape_string, 218 mysql_stmt, 263 N \n, 378, 444 name, 142, 143 $name, 129, 130 new Database, 268 normalization, 231–232 NOT BETWEEN AND , 318 NOT LIKE, 318 NOT NULL, 280, 296 not operator, 100 notices, 58 NULL, 280 AUTO_INCREMENT, 296 DELETE, 364 if, 95 MySQL, 280 variables, 74, 207 $number, 60 numbers, 277–278 floating-point, 50, 52, 207, 278 MySQL, 277–278 474 www.it-ebooks.info bindex.indd 474 10/3/2011 12:47:00 PM Tarr bindex.indd V2 - 09/23/2011 Page 475 number_format – ports strings, 52, 206 variables, 50–51, 207 number_format(), 52 numeric arrays, 72 numeric operators, 51 num_rows, 265 O objects See also PHP Data Objects classes, 178–182, 420 complex data, 86 construct(), 182 foreach, 112 MySQL, 254 OOP, 162–163 value, $this, 272 variables, 207 object-oriented programming (OOP), 161–165 classes, 162–163, 167–175 mysqli, 266 one-to-many relationships, 230 one-to-one relationships, 230 OOP See object-oriented programming operator precedence, 100 operators assignment, 46, 50, 51 comparison, 94–96, 318 comparison functions and operators, 317 concatenation, 48, 287 decrement, 108, 110 increment, 108, 110 logical, 97–100 not, 100 numeric, 51 precedence, 100 resolution, 195 ternary, 96–97 , 143 OR, 98 ORDER BY, 316–317, 363 OUTER JOIN, 334 P , 422 parameters, 38, 350 arguments, 128 arrays, 128 defaults, 130 Eclipse, 171 functions, 127–131 GET, 154 $_GET, 81 hidden, 151 loops, 128 parent class, 195 parent class, 192, 195 Pass by Reference, 163 passwords, 9, 389–390 best practices, 389–390 editRecord(), 410 GET, 81 hash functions, 400, 405 PHP, 400–402 user logins, 400–402 Paste, 17 PDO See PHP Data Objects PDO, 269 PDOException, 269 PDO::PARAM_BOOL, 351 PDO::PARAM_INT, 351 PDO::PARAM_LOB, 351 PDO::PARAM_STR, 351 PDOStatement, 269 PDO_Statement::bindParm(), 350 Pear Coding Standards, 34 Perl, perspectives, 18, 66 PHP case sensitivity, 46 data selection, 319 deleting data, 364–365 echo, 27–29 errors, 209 formatting style, 33–34 forms, MySQL data entry, 302–304 HTML, 23, 107, 111 while, 107 include, 27–29 loosely typed language, 206 MySQL, 241, 263–274 commands, 297–302 forms, 302–304 tables, 287–288 OOP, 163–164 passwords, 400–402 scope, 119 statements, 91–94, 263 superglobal variables, 120 syntax, 33–44 Unix timestamps, 74 UPDATE, 345–347 web pages, 23–32 whitespace, 126 php, 24, 30, 35, 40–43