- Page 1: Front cover Developing PHP Applicat
- Page 5 and 6: Contents Figures . . . . . . . . .
- Page 7 and 8: 5.1.5 Setting up PHP with multiple
- Page 9 and 10: Figures 1-1 Web application infrast
- Page 11 and 12: Tables 2-1 Customer use case: Regis
- Page 13 and 14: Notices This information was develo
- Page 15 and 16: Preface This IBM Redbook will help
- Page 17 and 18: Kiran H. Nair is Advisory Software
- Page 19 and 20: 1 Chapter 1. Technology overview As
- Page 21 and 22: ► ► ► return, whereas a wirel
- Page 23 and 24: Web browser HTTP Request Web server
- Page 25 and 26: ► ► ► ► ► ► ► provide
- Page 27 and 28: nothing architecture on one or diff
- Page 29 and 30: triggers, functions, and joins. Clo
- Page 31 and 32: custom modules. You can also exerci
- Page 33 and 34: Important: Use either the prefork M
- Page 35 and 36: Important: If you are going to use
- Page 37 and 38: PHP is a powerful server-side scrip
- Page 39 and 40: } } echo 'Stories for kids mostly';
- Page 41 and 42: the Cloudscape Network Server using
- Page 43 and 44: a high level overview of the availa
- Page 45 and 46: ► ► Based on ODBC (needs Inform
- Page 47 and 48: ► ► ► ► - Outstanding run-t
- Page 49 and 50: 2 Chapter 2. Sample scenario descri
- Page 51 and 52: 2.1 Application requirements Before
- Page 53 and 54:
Start Login Orders page Orders Does
- Page 55 and 56:
Figure 2-3 The customer registratio
- Page 57 and 58:
Description Basic course of action:
- Page 59 and 60:
Table 2-5 Customer use case: See ve
- Page 61 and 62:
Table 2-7 shows the requirements fo
- Page 63 and 64:
Table 2-9 shows the requirements fo
- Page 65 and 66:
number. Promotions may be added to
- Page 67 and 68:
Once there are any vehicles added,
- Page 69 and 70:
Description Basic course of action:
- Page 71 and 72:
► ► Maintainable. The use of Ob
- Page 73 and 74:
► The INVENTORY table contains in
- Page 75 and 76:
HTTP Request HTTP Response 1 Contro
- Page 77 and 78:
cannot be accessed directly. Or, yo
- Page 79 and 80:
After we have determined our data m
- Page 81 and 82:
Figure 2-23 An implementation only
- Page 83 and 84:
public function insertObject($sql,
- Page 85 and 86:
} 2.3.4 Database adapters A databas
- Page 87 and 88:
public abstract function delete($sq
- Page 89 and 90:
2.3.5 Conclusion compensate for dyn
- Page 91 and 92:
There will be some errors here abou
- Page 93 and 94:
3 Chapter 3. Zend installation and
- Page 95 and 96:
3. Unzip the downloaded file: cd t
- Page 97 and 98:
http://server:port/ZendCore/ To lea
- Page 99 and 100:
The Zend Core for IBM on Windows en
- Page 101 and 102:
and a guide for customizing the sam
- Page 103 and 104:
Figure 3-6 Zend Studio 5.1.0 instal
- Page 105 and 106:
Figure 3-8 Project Properties ► D
- Page 107 and 108:
Figure 3-11 Adding SQL server to th
- Page 109 and 110:
Figure 3-12 Zend Studio Client Tool
- Page 111 and 112:
Figure 3-15 Watches debug window 7.
- Page 113 and 114:
4 Chapter 4. PHP application develo
- Page 115 and 116:
will need the following tools: gcc,
- Page 117 and 118:
db2setup.err, located, by default,
- Page 119 and 120:
Configuring an Apache Derby or IBM
- Page 121 and 122:
the main Apache process when Apache
- Page 123 and 124:
• Path /opt/IBM/db2/V8.1 is the d
- Page 125 and 126:
cd .. rm configure ./buildconf --fo
- Page 127 and 128:
Note: At the time of writing, the l
- Page 129 and 130:
$conn_resource = db2_connect($db_na
- Page 131 and 132:
Connection to database failed. SQLS
- Page 133 and 134:
connections to the database, it is
- Page 135 and 136:
Handling transactions DB2_AUTOCOMMI
- Page 137 and 138:
► ► Forward only cursors This i
- Page 139 and 140:
$stmt $stmt = db2_exec($conn_resour
- Page 141 and 142:
Prepare the statement $stmt = db2_p
- Page 143 and 144:
statement resource obtained after t
- Page 145 and 146:
$stmt = db2_exec($conn,$statement);
- Page 147 and 148:
► PHP variable with just path The
- Page 149 and 150:
Example 4-14 Fetching image from DB
- Page 151 and 152:
} echo 'with Message: ' . db2_stmt_
- Page 153 and 154:
depend on the boolean return values
- Page 155 and 156:
while ($row = db2_fetch_array($stmt
- Page 157 and 158:
if (!$stmt) { echo 'The prepare fai
- Page 159 and 160:
► [PDO connection pooling] ;can h
- Page 161 and 162:
$constrng = 'ibm:DSN=dlrshp;UID=db2
- Page 163 and 164:
$dbh = new PDO($constrng, 'db2inst1
- Page 165 and 166:
Handling transactions PDO, by defau
- Page 167 and 168:
} How to catch an error As discusse
- Page 169 and 170:
Isolation level to use Consideratio
- Page 171 and 172:
You can see how you set the cursor
- Page 173 and 174:
} ?> echo 'Exception: ' . $exp->get
- Page 175 and 176:
Output parameter $sth->bindParam(2,
- Page 177 and 178:
Using scrollable cursors We can scr
- Page 179 and 180:
Free the resources You need to clos
- Page 181 and 182:
The steps taken by a Unified ODBC p
- Page 183 and 184:
odbc_commit($conn); odbc_autocommit
- Page 185 and 186:
} odbc_free_result($result); Using
- Page 187 and 188:
} echo 'Execution failed: ' . odbc_
- Page 189 and 190:
If using Windows, change the TraceP
- Page 191 and 192:
Once the program calls the db2_conn
- Page 193 and 194:
The level of logging is decided by
- Page 195 and 196:
Figure 4-1 Selecting your wizard Yo
- Page 197 and 198:
Figure 4-3 Event monitors in Contro
- Page 199 and 200:
Do the following steps to use the e
- Page 201 and 202:
-- 10 solutions were evaluated by t
- Page 203 and 204:
The steps involved in cataloging th
- Page 205 and 206:
5 Chapter 5. PHP applications with
- Page 207 and 208:
equire that the Web server machine
- Page 209 and 210:
main(int argc, char **argv) { char
- Page 211 and 212:
machines need to know on which port
- Page 213 and 214:
PHYSFILE 10000 # Physical log file
- Page 215 and 216:
Troubleshooting at initialization t
- Page 217 and 218:
The benefit of using precompiled pa
- Page 219 and 220:
Build and install Apache Web server
- Page 221 and 222:
server are on one machine and Infor
- Page 223 and 224:
way to check which options are buil
- Page 225 and 226:
You will notice that there is no da
- Page 227 and 228:
usr/local/bin. The PEAR repository
- Page 229 and 230:
| This software is subject to the P
- Page 231 and 232:
PEAR 1.4.6 stable The unixODBC inte
- Page 233 and 234:
Configuring Apache with PHP We have
- Page 235 and 236:
apache2ctl -k start ► Apache V1.3
- Page 237 and 238:
printf(""); } catch (PDOException $
- Page 239 and 240:
if ( $return == 0 ) { printf(""); p
- Page 241 and 242:
used here another script written wi
- Page 243 and 244:
Figure 5-6 unixODBC PHP parameters
- Page 245 and 246:
object file: No such file or direct
- Page 247 and 248:
Id Stmt type Database Lvl Mode ERR
- Page 249 and 250:
* database port 1526 */ /* database
- Page 251 and 252:
if (!dbh) { exit(); } /* Using PDO:
- Page 253 and 254:
"'" . $_POST["year"] . "'," . "'" .
- Page 255 and 256:
* Affected rows ? Inserted Serial V
- Page 257 and 258:
function simpleQuery($query) { $ism
- Page 259 and 260:
Example 5-43 Inserts with dynamic S
- Page 261 and 262:
For our Dealership application, wit
- Page 263 and 264:
$statement="DELETE FROM customer WH
- Page 265 and 266:
$parm5=11400; $parm6="cheque"; $par
- Page 267 and 268:
{ printf(" %s %s %s \n",$row[0],$ro
- Page 269 and 270:
Example 5-49 Using a class for fetc
- Page 271 and 272:
) The standard cursor allows you to
- Page 273 and 274:
Output: Array ( [0] => HY106 [1] =>
- Page 275 and 276:
Output without the CursorBehavior=0
- Page 277 and 278:
*/ $statement='SELECT c_last,c_stre
- Page 279 and 280:
} printf(""); exit(); /* simple que
- Page 281 and 282:
$row=$res->fetchRow(); if ($row) {
- Page 283 and 284:
issued. Looking further in the exam
- Page 285 and 286:
Example 5-62 Returning all rows in
- Page 287 and 288:
} /* for using the SQL interface ru
- Page 289 and 290:
} exit(); printf(" ****************
- Page 291 and 292:
For the explanation about why the f
- Page 293 and 294:
print_r(($error=$dbh->errorInfo()))
- Page 295 and 296:
The Informix IDS database server pr
- Page 297 and 298:
DROP PROCEDURE informix.register_us
- Page 299 and 300:
$DEBUG=1; if (isset($_POST["Button"
- Page 301 and 302:
DEFINE llocal_m_ac char(1); DEFINE
- Page 303 and 304:
let local_m_automatic = * expressio
- Page 305 and 306:
printf(""); printf(""); printf("");
- Page 307 and 308:
p_id integer, f_m_id integer, p_amo
- Page 309 and 310:
END PROCEDURE; Stored procedures wi
- Page 311 and 312:
$stmt = $dbh->prepare($spstatement)
- Page 313 and 314:
t_ac = local_m_ac and t_powerwindow
- Page 315 and 316:
new or used car for an user and pro
- Page 317 and 318:
if (isset($_POST["Rev"])) { $spstat
- Page 319 and 320:
let local_m_package = trim(m_packag
- Page 321 and 322:
t_year::int = local_m_year and t_co
- Page 323 and 324:
fclose ( $file); $stmt->bindParam(1
- Page 325 and 326:
In Example 5-76 on page 304, the da
- Page 327 and 328:
Example 5-80 on page 309 shows how
- Page 329 and 330:
* representation as blob object */
- Page 331 and 332:
$cn = odbc_connect("Driver=Informix
- Page 333 and 334:
} exit(); @odbc_close($cn); ?> SBLO
- Page 335 and 336:
Example 5-86 Exceptions with Inform
- Page 337 and 338:
$error=$dbh->errorInfo(); print_r($
- Page 339 and 340:
Error handling with ifx_* The ifx_*
- Page 341 and 342:
Example 2: Table doesn’t exist O
- Page 343 and 344:
} exit(); $str="SELECT * from carlo
- Page 345 and 346:
Additionally, there is an Informix
- Page 347 and 348:
?> If you do not work with the SQL
- Page 349 and 350:
{ printf("ROLLBACK %s %s \n",odbc_e
- Page 351 and 352:
5.2.9 PHP and Informix XPS SQL exte
- Page 353 and 354:
Example 5-103 provides you with a g
- Page 355 and 356:
MERGE statement In the Dealership a
- Page 357 and 358:
inventory table. When you use the s
- Page 359 and 360:
t_model = local_m_model and t_year:
- Page 361 and 362:
The values for columns in the resul
- Page 363 and 364:
1777 489e4d30 47e14880 2 cond wait
- Page 365 and 366:
10:51:58 Checkpoint Completed: dura
- Page 367 and 368:
- Restart the Apache Web server, us
- Page 369 and 370:
Figure 5-8 IBM Informix ODBC Driver
- Page 371 and 372:
6 Chapter 6. Port PHP applications
- Page 373 and 374:
DB2 migration services and support
- Page 375 and 376:
procedure name since a built-in fun
- Page 377 and 378:
'- NO EXTERNAL ACTION -' >--+------
- Page 379 and 380:
END@ In DB2, the BEGIN ATOMIC state
- Page 381 and 382:
Variables Variable SET statements i
- Page 383 and 384:
--+--------------------------------
- Page 385 and 386:
Example 6-10, the check_upd trigger
- Page 387 and 388:
In DB2, both Materialized Query Tab
- Page 389 and 390:
only minor syntax changes, the ALGO
- Page 391 and 392:
► ibm_db2 for PHP 4 and PHP 5.
- Page 393 and 394:
The mysqli functions are the improv
- Page 395 and 396:
Example 6-22 Connecting to a catalo
- Page 397 and 398:
$database = 'dlrshp'; $user = 'root
- Page 399 and 400:
Example 6-28 Updating a DB2 databas
- Page 401 and 402:
} ?> echo 'Error code: ' . mysql_er
- Page 403 and 404:
Example 6-33 Handling a prepared st
- Page 405 and 406:
Bind the parameters. $price = '2400
- Page 407 and 408:
► ► ► The syntax of the funct
- Page 409 and 410:
$custid = 1; $dlrid = 1; $vehid = 1
- Page 411 and 412:
A Appendix A. An introduction to Se
- Page 413 and 414:
including support for iteration, st
- Page 415 and 416:
property is read-only. Not all thes
- Page 417 and 418:
was found. To do this with XPath re
- Page 419 and 420:
Table A-2 "address" table definitio
- Page 421 and 422:
$table_metadata = array($contact_ta
- Page 423 and 424:
A.5.3 More on SDO navigation The pr
- Page 425 and 426:
$contact = $address->getContainer()
- Page 427 and 428:
client application can then continu
- Page 429 and 430:
} A.6 Summary SDOs add some interes
- Page 431 and 432:
B Appendix B. Additional material T
- Page 433 and 434:
Related publications The publicatio
- Page 435 and 436:
► IBM Informix Guide to SQL: Refe
- Page 437 and 438:
Index Symbols ++ 131 .htaccess 229
- Page 439 and 440:
E e-business 6 Edit mode 88 EM64T 1
- Page 441 and 442:
odbc_prepare 303 odbc_result 167, 2
- Page 443 and 444:
unixODBC 231, 312, 330 untrusted se
- Page 445:
Developing PHP Applications for IBM