外文文献-基于php的网上购物系统内容摘要:

fromthe object. It also returns the results as another object instead of a result set: $query = SELECT * FROM books $result = $connectionquery($query)。 Based on the SQL query, this code calls the query function fromthe connection object and returns a result object named $result. Fetching Line 22 uses the result object to call the fetchRow method. It returns the rows one at a time, similar to mysql_fetch_row: while ($result_row = $resultfetchRow( )) { echo 39。 Title: 39。 .$result_row[1] . 39。 br /39。 echo 39。 Author: 39。 .$result_row[4] . 39。 br / 39。 echo 39。 Pages: 39。 .$result_row[2] . 39。 br /br /39。 } Use another while loop to go through each row from fetchRow until it returns FALSE. The code in the loop hasn’t changed from the nonPEAR example. Closing You’re finished with the database connection, so close it using the object method disconnect: $connectiondisconnect( )。 PEAR error reporting The function DB::isError will check to see whether the result that’s been returned to you is an error. If it is an error, you can use DB::errorMessage to return a text description of the error that was generated. You need to pass DB::errorMessage, the return value from your function, as an argument. Here you rewrite the PEAR code to use error checking: ?php if ( DB::isError( $demoResult = $dbquery( $sql))) { echo DB::errorMessage($demoResult)。 } else { while ($demoRow = $demoResultfetchRow( )) { 外文文献原文及译文 第 7 页 共 6 页 echo $demoRow[2] . 39。 br /39。 } } ? There’s also a new version of the PEAR database interface called PEAR::MDB2. The same results display, but there are more functions available in this version of the PEAR database abstraction layer. The thesis expounds how to build an EBusiness web site by use of software tools such as PHP, DELPHI and so on. The design keeps to the classic life cycle of software engineering (waterfall model). According to software analysis, software design, software code and software maintenance, the design is divided into nine processes such as define systematic goal, feasibility analysis, demand analysis, outline design, design, software code, software test in detail, software maintain. In the web interface of user, we adopt B/S structure. And we adopt C/S to backstage supporter management logic layer that needs data mining. Variables are prefixed with a dollar symbol and a type does not need to be specified in advance. Unlike function and class names, variable names are case sensitive. Both doublequoted () and heredoc strings allow the ability to embed a variable39。 s value into the string. PHP treats newlines as whitespace in the manner of a freeform language (except when inside string quotes), and statements are terminated by a semicolon. PHP has three types of ment syntax: /* */ serves as block ments, and // as well as are used for inline ments. The echo statement is one of several facilities PHP provides to output text (. to a web browser). In terms of keywords and language syntax, PHP is similar to most high level languages that follow the C style syntax. If conditions, for and while loops, and function returns are similar in syntax to languages such as C, C++, Java and Perl. PHP stores whole numbers in a platformdependent range. This range is typically that of 32bit signed integers. Unsigned integers are converted 毕业论文 values in certain situations。 this behavior is different from other programming variables can be assigned using decimal (positive and negative), octal, and hexadecimal notations. Floating point numbers are also stored in a platformspecific range. They can be specified using floating point notation, or two forms of scientific notation. PHP has a native Boolean type that is 外文文献原文及译文 第 8 页 共 6 页 similar to the native Boolean types in Java and C++. Using the Boolean type conversion rules, nonzero values are interpreted as true and zero as false, as in Perl and C++.The null data type represents a variable that has no value. The only value in the null data type is NULL. Variables of the resource type represent references to resources from external sources. These are typically created by functions from a particular extension, and can only be processed by functions from the same extension。 examples include file, image, and database resources. Arrays can contain elements of any type that PHP can handle, including resources, objects, and even other arrays. Order is preserved in lists of values and in hashes with both keys and values, and the two can be intermingled. PHP also supports strings, which can be used with single quotes, double quotes, or heredoc syntax. The Standard PHP Library (SPL) attempts to solve standard problems and implements efficient data access interfaces and classes. PHP has hundreds of base functions and thousands more via extensions. These functions are well documented on the PHP site, but unfortunately, the builtin library has a wide variety of naming conventions and inconsistencies. PHP currently has no functions for thread programming. Functions are not firstclass functions and can only be referenced by their namedirectly or dynamically by a variable containing the name of the function. Userdefined functions can be created at any time without being prototyped. Functions can be defined inside code blocks, permitting a runtime decision as to whether or not a function should be defined. Function calls must use parentheses, with the exception of zero argument class constructor functions called with the PHP new operator, where parentheses are optional. PHP supports quasianonymous functions through the create_function() function, although they are not true anonymous functions because anonymous functions are nameless, but functions can only be referenced by name, or indirectly through a variable $function_name()。 , in PHP. PHP gai。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。