ch15_01.htm:
The ALTER ch15_01.htm:
Creates new database elements (or entirely new databases). This ch15_01.htm:
In addition to the main types, several modifiers can also be used to ch15_01.htm:
Deletes rows from a table. When used without a ch15_01.htm:
Gives information about a table or column. While this statement works ch15_01.htm:
Permanently remove a database, table, index, or function from the ch15_01.htm:
Displays verbose information about the order and structure of a ch15_01.htm:
Flushes or resets various internal processes depending on the ch15_01.htm:
Previous to MySQL 3.22.11, the GRANT statement was ch15_01.htm:
Inserts data into a table. The first form of this statement simply ch15_01.htm:
| KILL |
KILL thread_id |
Terminates the specified thread. The thread ID numbers can be found ch15_01.htm:LOAD DATA [LOCAL] INFILE file [REPLACE|IGNORE] INTO TABLE table [delimiters] [(columns)]
Reads a text file that is in a readable format and inserts the data ch15_01.htm:
Locks a table for the use of a specific thread. This command is ch15_01.htm:
Recreates a table eliminating any wasted space. This is done by ch15_01.htm:
Inserts data to a table, replacing any old data that conflicts. This ch15_01.htm:
Removes a privilege from a user. The values of privilege, table, and ch15_01.htm:
Retrieve data from a database. The SELECT ch15_01.htm:
Defines an option for the current session. Values set by this ch15_01.htm:
Displays various information about the MySQL system. This statement ch15_01.htm:
Unlocks all tables that were locked using the LOCK ch15_01.htm:
Alters data within a table. This statement is used to change actual ch15_01.htm:
Selects the default database. The database given in this statement is ch15_02.htm:
Creates new database elements (or entirely new databases). This ch15_02.htm:
Deletes rows from a table. When used without a ch15_02.htm:
Permanently remove a table, index, or sequence from the mSQL system.
WARNING
ch15_02.htm:Inserts data into a table. This statement inserts the given values ch15_02.htm:
Retrieves data from a database. The SELECT ch15_02.htm:
Alters data within a table. This statement is used to change actual ch17_01.htm:
Performs operations on the database table files themselves (called ch17_01.htm:
Displays information about ISAM logs. An ISAM log is generated if the ch17_01.htm:
The MySQL command line monitor. This program is the most basic way to ch17_01.htm:
Displays and modifies access rights for the MySQL server. You may ch17_01.htm:
Performs operations that affect the database server as a whole. This ch17_01.htm:
ch18_01.htm:$escaped_string = addslashes($string);
mysqlbug
mysqlbugReport a bug in a MySQL program or utility. This program collects ch17_01.htm:
The MySQL server daemon. All other programs interact with the ch17_01.htm:
Outputs the contents of the given database (or table within a ch17_01.htm:
Reads a file of data in a variety of common formats (such as comma ch17_01.htm:
Displays the layout of the requested database, table or field. If no ch17_02.htm:
The mSQL command line monitor. This program is the most basic way to ch17_02.htm:
The mSQL server daemon. All other programs interact with the database ch17_02.htm:
Performs operations that affect the database server as a whole. This ch17_02.htm:
Outputs the contents of the given database (or table within a ch17_02.htm:
Outputs the contents of the given table in ASCII delimited format.
ch17_02.htm:Reads an ASCII delimited file and inserts the data into the given ch17_02.htm:
Displays the layout of the requested database, table, index, or ch18_01.htm:
Returns the absolute value of number.
Returns a copy of string with any ch18_01.htm:
Returns a sorted copy of the associative array ch18_01.htm:
Returns the decimal equivalent of binary.
Rounds number to the next highest integer and ch18_01.htm:
Changes the current working directory to directory.
ch18_01.htm:Changes the file file to belong to the group ch18_01.htm:
Changes the file to have the permissions ch18_01.htm:
Changes the file to belong to the owner owner. ch18_01.htm:
Returns string with all trailing new lines, ch18_01.htm:
Returns the character that corresponds to the ASCII value of ch18_01.htm:
Empties the current stack. This function is a kludge designed to ch18_01.htm:
Empties the cache used for any functions that access information ch18_01.htm:
Closes a directory opened with opendir.
ch18_01.htm:Stops all logging done via syslog.
ch18_01.htm:Returns the cosine of number.
ch18_01.htm:$number = count($array);Returns the number of elements in array. If ch18_01.htm:$encrypted_string = crypt($string, $salt);
Returns an encrypted version of string. The ch18_01.htm:
Returns time (a standard Unix time as given by the ch18_01.htm:$db_info = dblist();
Returns a list of the databases supported by PHP.
ch18_01.htm:$binary = decbin($decimal);Returns the binary equivalent of decimal.
ch18_01.htm:$hex = dechex($decimal);Returns the hexadecimal equivalent of decimal.
ch18_01.htm:$octal = decoct($decimal);Returns the octal equivalent of decimal.
ch18_01.htm:$double = doubleval($variable);Returns variable as a floating point number.
ch18_01.htm:echo [format_string] expression [, expression ...]This is not a true function but rather PHP's built-in version ch18_01.htm:end($array);
Sets the internal pointer of array to the end of ch18_01.htm:$result = ereg($expression, $string);
$result = ereg($expression, $string, $match_array);
Returns a true value if string matches the regular ch18_01.htm:$result = eregi($expression, $string, $match_array);
Identical to ereg except that case is ignored ch18_01.htm:ereg_replace($expression, $replacement_string, $string);
Replaces all parts of string that match ch18_01.htm:eregi_replace($expression, $replacement_string, $string);
Identical to ereg_replace except that case is ch18_01.htm:$safe_string = escapeshellcmd($string);
Returns a copy of string with its characters ch18_01.htm:eval($string);
Evaluates the contents of string as if it were a ch18_01.htm:
$last_line = exec($command, $output_array);
Executes command as a Unix command in a subshell. ch18_01.htm:exit();
Ends all parsing of the HTML file.
ch18_01.htm:$result = exp($number);Returns the number e raised to the ch18_01.htm:fclose($fd);
Closes a file opened by fopen.
ch18_01.htm:$result = feof($fd);Returns true if the file descriptor fd is at the ch18_01.htm:$line = fgets($fd, $max_bytes);
Returns the next line (up to max_bytes in length) ch18_01.htm:fgetss
$line = fgetss($fd, $max_bytes); |
Identical to fgets except that it attempts to ch18_01.htm:$array = file($filename);
Returns an array containing every line in the file ch18_01.htm:$time = fileatime($filename);
Returns (in standard Unix time format) the last time ch18_01.htm:$time = filectime($filename);
Returns (in standard Unix time format) the last time ch18_01.htm:$group_id = filegroup($filename);
Returns the group ID of filename's group. If this information ch18_01.htm:$inode = fileinode($filename);
Returns the inode of filename. If this information ch18_01.htm:$time = filemtime($filename);
Returns (in standard Unix time format) the last time ch18_01.htm:$owner = fileowner($filename);
Returns the ID of the owner of the file. If this information cannot ch18_01.htm:$permissions = fileperms($filename);
Returns the permissions of filename. If this ch18_01.htm:$size = filesize($filename);
Returns the size of filename in bytes. If this ch18_01.htm:$type = filetype($filename);
Returns one of the following, indicating the type of ch18_01.htm:$lower_integer = floor($number);
Rounds number to the next lowest integer and ch18_01.htm:flush();
Flushes the buffer on the standard output so that the end user ch18_01.htm:$fd = fopen($filename, $mode);
Opens the file filename in the mode mode and returns a file ch18_01.htm:fputs($fd, $string);
Writes string to the file associated with ch18_01.htm:fpassthru($fd);
Directly prints all of the remaining data in the file associated with ch18_01.htm:fseek($fd, $position);
Positions the file associated with fd to ch18_01.htm:$fd = fsockopen($hostname,$port);
Opens a connection with hostname on port ch18_01.htm:$position = ftell($fd);
Returns the position of the pointer in the file associated with ch18_01.htm:$directory = getaccdir();
Returns the directory where the PHP configuration files are held.
ch18_01.htm:$value = getenv($variable);Returns the value of the environment variable ch18_01.htm:$address = gethostbyname($hostname);
Returns the IP address of hostname.
ch18_01.htm:$hostname = gethostbyaddr($address);Returns the hostname of the machine with the IP address ch18_01.htm:$file_info_array = getimagesize($filename);
Returns an array of information about the image in the file ch18_01.htm:$time = getlastaccess();
Returns (in standard Unix time format) the date and time the page was ch18_01.htm:$browser = getlastbrowser();
Returns the identification string of the last browser to access the ch18_01.htm:$email = getlastemail();
Returns the e-mail address of the last person to access the page. ch18_01.htm:$host = getlasthost();
Returns the hostname of the last machine to access the page. This ch18_01.htm:$time = getlastmod();
Returns the time (in standard Unix time format) that the page was ch18_01.htm:$url = getlastref();
Returns the URL of the referring page of the last visitor to the ch18_01.htm:$directory = getlogdir();
Returns the directory that contains the PHP log files.
ch18_01.htm:$inode = getmyinode();Returns the inode of the HTML file that contains the current PHP ch18_01.htm:$pid = getmypid();
Returns the process ID number of the current PHP process.
ch18_01.htm:$id = getmyuid();Returns the user ID of the owner of the HTML file that contains the ch18_01.htm:$number = getrandmax();
Returns the largest possible number that will be returned by ch18_01.htm:$time = getstartlogging();
Returns the time (in standard Unix format) that logging began on the ch18_01.htm:$hits = gettoday();
Returns the number of hits the page has received since midnight at ch18_01.htm:$hits = gettotal();
Returns the total number of hits the page has received since logging ch18_01.htm:$formatted_date = gmdate($format, $time);
Identical to Date except that it uses Greenwich Mean time to ch18_01.htm:header($header_string);
Outputs header_string as the HTTP header of the ch18_01.htm:$decimal = hexdec($hex);
Returns the decimal equivalent of hex.
ch18_01.htm:$html_string = htmlspecialchars($string);Returns string, replacing any special characters (including <, ch18_01.htm:imagearc($image, $cx, $cy, $width, $height, $start, $end, $color);
Draws a partial ellipse in image with the color ch18_01.htm:imagechar($image, $size, $x, $y, $character, $color);
Draws character in image with the color ch18_01.htm:imagecharup($image, $size, $x, $y, $character, $color);
Identical to imagechar except that the character ch18_01.htm:$color = imagecolorallocate($image, $red, $green, $blue);
Returns a color for use with the image image using ch18_01.htm:imagecolortransparent($image, $color);
Sets color as the transparent color for ch18_01.htm: $dest_width, $dest_heigth, $src_width, $src_heigth);
Copies a rectangular portion from src_image and ch18_01.htm:$image = imagecreate($width, $height);
Returns an image indentifier representing a new image with the ch18_01.htm:$image = imagecreatefromgif($filename);
Returns an image indentifier representing the image contained in the ch18_01.htm:imagedestroy($image);
Frees any resources occupied by image.
ch18_01.htm:imagefill($image, $x, $y, $color);Flood fills image with the color ch18_01.htm:imagefilledpolygon($image, $points_array, $num_points, $color);
Creates a polygon in image filled with the color ch18_01.htm:imagefilledrectangle($image, $x1, $y1, $x2, $y2, $color);
Creates a rectangle in image filled with the color ch18_01.htm:imagefilltoborder($image, $x, $y, $border, $color);
Identical to imagefill except that the fill stops ch18_01.htm:imagegif($image);
imagegif($image, $filename);
Outputs the contents of image as a GIF image. If a ch18_01.htm:imageinterlace($image, $interlace);
Toggles the interlace bit of image to the value of ch18_01.htm:imageline($image, $x1, $y1, $x2, $y2, $color);
Creates a line in image of color ch18_01.htm:imagepolygon($image, $points, $numpoints, $color);
Identical to imagefilledpolygon except that the ch18_01.htm:imagerectangle($image, $x1, $y1, $x2, $y2, $color);
Identical to imagefilledrectangle except that the ch18_01.htm:imagesetpixel($image, $x, $y, $color);
Draws a single point on image at ch18_01.htm:imagestring($image, $size, $x, $y, $string, $color);
Identical to imagechar except that it outputs the ch18_01.htm:imagestringup($image, $size, $x, $y, $string, $color);
Identical to imagecharup except that it outputs ch18_01.htm:$x_size = imagesx($image);
Returns the width of image in pixels.
ch18_01.htm:$y_size = imagesy($image);Returns the height of image in pixels.
ch18_01.htm:include($filename);Includes the file filename in the current page. ch18_01.htm:initsyslog();
Prepares the system for syslog logging. After ch18_01.htm:$integer = intval($variable);
Returns the contents of variable as an integer.
ch18_01.htm:$defined = isset($variable);Returns 1 if variable is defined, 0 otherwise.
ch18_01.htm:$key = key($array);Returns the key of the next element in array. For ch18_01.htm:link($target, $filename);
Creates a hard link from filename to ch18_01.htm:$info = linkinfo($filename);
Returns a true value if the link filename exists ch18_01.htm:$result = log($number);
Returns the natural logarithm of number.
ch18_01.htm:$result = log10($number);Returns the base 10 logarithm of number.
ch18_01.htm:logas($filename);Logs the hit on the current page as a hit on ch18_01.htm:mail($to, $subject, $message);
mail($to, $subject, $message, $headers);
Sends an e-mail message to to with the subject ch18_01.htm:$maximum = max($array);
Returns the largest value in array. If ch18_01.htm:$hash = md5($string);
Returns the MD5 hash of string.
ch18_01.htm:$ms = microtime();Returns a string that contains the fractional part of the current ch18_01.htm:$minimum = min($array);
Returns the minimum value in array. If array ch18_01.htm:mkdir($directory, $mode);
Creates the directory directory with the given ch18_01.htm:$time = mktime($hour,$minute,$second,$month,$day,$year);
Returns a time in standard Unix time format based on the parameters ch18_01.htm:$result = mysql($database, $query);
Sends the query query to the mSQL/MySQL database ch18_01.htm:$num_rows = mysql_affected_rows();
Returns the number of rows affected by the last ch18_01.htm:mysql_close();
Closes the connection to the mSQL/MySQL database server.
ch18_01.htm:mysql_connect($hostname, $username, $password);Creates a connection with the mSQL/MySQL database server at ch18_01.htm:mysql_createdb($database);
Creates the given database.
ch18_01.htm:$db = mysql_dbname($result, $i);Returns the name of the database stored in the ith ch18_01.htm:mysql_dropdb($database);
Removes database and all tables within it.
ch18_01.htm:$flags = mysql_fieldflags($result, $i);Returns the flags belonging to the ith field of ch18_01.htm:$length = mysql_fieldlen($result, $i);
Returns the length of the ith field of result.
ch18_01.htm:$name = mysql_fieldname($result, $i);Returns the column name of the ith field of ch18_01.htm:$type = mysql_fieldtype($result, $i);
Returns the type of the ith of ch18_01.htm:mysql_freeresult($result);
Frees the memory associated with a mSQL/MySQL result. All memory is ch18_01.htm:$id_num = mysql_insert_id();
Returns the ID number used for the last INSERT statement that ch18_01.htm:$result = mysql_listdbs();
Returns a result pointer containing the names of all of the databases ch18_01.htm:$result = mysqllistfields($database, $table);
Returns a result pointer to information about the fields of the table ch18_01.htm:$result = mysql_listtables($database);
Returns a result pointer containing the names of all of the tables ch18_01.htm:$num_fields = mysql_numfields($result);
Returns the number of fields within result.
ch18_01.htm:$num_rows = mysql_numrows($result);_Returns the number of rows within result.
ch18_01.htm:$new_string = msql_regcase($string);Returns a copy of string which has been ch18_01.htm:$result_string = mysql_result($result, $I, $field);
Returns an entry from the field field in the ch18_01.htm:$name = mysql_tablename($result, $i);
Returns the name of the table stored in the ith ch18_01.htm:
| next |
ch18_01.htm:$decimal = octdec($octal);
Returns the decimal equivalent of octal.
Opens a directory for use with the readdir ch18_01.htm:openlog($ident, $options, $facility);
Opens the system log for writing. This function should be called ch18_01.htm:$number = ord($character);
Returns the ASCII value of character.
ch18_01.htm:parse_str($string);Parses a URL encoded string of the format ch18_01.htm:passthru($command, $return_value);
Executes the external command command and sends ch18_01.htm:pclose($fd);
Closes a pipe opened with popen.
ch18_01.htm:phpinfo();Prints an informational page that's useful when debugging the ch18_01.htm:$version = phpversion();
Returns the version of PHP that is currently running.
ch18_01.htm:$fd = popen($command, $mode);Runs the external command command and either sends ch18_01.htm:$position = pos($array['element']);
Returns the numerical position of ch18_01.htm:$result = pow($x, $y);
Returns x raised to the power y.
ch18_01.htm:$element = prev($array);Moves the internal pointer of array to the ch18_01.htm:putenv($string);
Puts string into the local environment. Note that ch18_01.htm:$quoted_string = quotemeta($string);
Returns string with all special characters escaped ch18_01.htm:$number = rand();
Returns a random number between ch18_01.htm:$file = readdir();
Returns the next directory entry in the current open directory and ch18_01.htm:$filesize = readfile($filename);
Outputs the contents of filename directly to the ch18_01.htm:$filename = readline($link);
Returns the path of the real file referenced by ch18_01.htm:$result = reg_match($expression, $string, $array);
Identical to ereg . This function is included ch18_01.htm:reg_replace($expression, $replacement, $string);
Identical to ereg_replace . This function is ch18_01.htm:$partial_string = reg_search($expression, $string, $array);
Identical to ereg except that the portion of ch18_01.htm:reset($array);
Moves the internal pointer of array to the first ch18_01.htm:return($value);
Exits the current user-defined function and returns ch18_01.htm:rewind($fd);
Moves the file pointer for fd to the beginning of ch18_01.htm:rewinddir();
Moves the current directory pointer to the beginning of the directory.
ch18_01.htm:rmdir($directory);Deletes directory if it is empty.
ch18_01.htm:$sorted_array = rsort($array)Returns a sorted copy of the nonassociative array ch18_01.htm:setcookie($name);
setcookie($name, $value, $expire, $path, $domain, $secure);
Sends a cookie with the given attributes to the browser. If only ch18_01.htm:seterrorreporting($value);
If value is 0, all errors will be disabled, ch18_01.htm:setlogging($value);
If value is nonzero, access logging for the ch18_01.htm:setshowinfo($value);
If value is nonzero, an informational footer will ch18_01.htm:settype($variable, $type);
Sets the type of variable to ch18_01.htm:$value = shl($number, $b);
Returns the value of number shifted ch18_01.htm:$value = shr($number, $b);
Returns the value of number shifted ch18_01.htm:$value = sin($number);
Returns the sine of number (in radians).
ch18_01.htm:sleep($seconds);Stops the processing of the page for seconds ch18_01.htm:$sorted_array = sort($array)
Returns a sorted copy of the nonassociative array ch18_01.htm:$soundex_key = soundex($string);
Returns the soundex key of string.
ch18_01.htm:$string = sprintf($format, $arg, [$arg, $arg, ...]);Returns format with each C printf-style variable ch18_01.htm:$value = sqrt($number);
Returns the square root of number.
ch18_01.htm:srand($integer);Seeds the random number generator with the value ch18_01.htm:strstr
$substring = strchr($string, $value);
$substring = strstr($string, $value);
Returns the portion of string that occurs starting ch18_01.htm:strtr($string, $set1, $set2);
Translates all characters in string that are in ch18_01.htm:$plain_string = stripslashes($escaped_string);
Removes all escape characters from escaped_string.
ch18_01.htm:$length = strlen($string);Returns the length of string.
ch18_01.htm:$substring = strrchr($string, $character);Searches string backwards for character. The function returns the ch18_01.htm:$substring = strtok($string, $characters);
$substring = strtok($characters);
Splits string up into substrings using any of the ch18_01.htm:$lc_string = strtolower($string);
Returns string with all characters converted to ch18_01.htm:$uc_string = strtoupper($string);
Returns string with all characters converted to ch18_01.htm:$string = strval($variable);
Returns variable as a string value.
ch18_01.htm:$substring = substr($string, $start, $length);Returns the portion of string that begins at ch18_01.htm:symlink($target, $filename);
Creates a symbolic link from filename to ch18_01.htm:syslog($level, $message);
Logs message to the system logs at the level ch18_01.htm:$results = system($command, $return_value);
Executes the external command command and returns ch18_01.htm:$value = tan($number);
Returns the tangent of number (in radians).
ch18_01.htm:$filename = tempnam($path, $prefix);Returns a filename, prepended with prefix, that ch18_01.htm:$time = time();
Returns the current time in Unix standard time format (the number of ch18_01.htm:umask($umask);
Returns the current umask if no argument is specified. Sets the umask ch18_01.htm:$result = uniqid();
Returns a value that is guaranteed to be unique compared to other ch18_01.htm:unlink($filename);
Deletes the specified file.
ch18_01.htm:unset($variable);Undefines the specified variable, which may be an element of an ch18_01.htm:$decoded_string = urldecode($string);
Returns a copy of string that has all URL escape codes translated ch18_01.htm:$encoded_string = urlencode($string);
Returns a copy of string that has all special characters URL encoded.
ch18_01.htm:usleep($ms);Stops the parsing of the script for ms ch18_01.htm:virtual($filename);
Includes filename exactly as if the tag ch18_02.htm:$result = chdir($path)
Changes directory to the specified path. If the operation is ch18_02.htm:$result = chmod($filename, $mode)
Changes the mode of the specified file to mode. If ch18_02.htm:$string = chop($string)
Returns the string with the last character removed. This is handy for ch18_02.htm:close ($fd)
Closes the file associated with the file descriptor.
ch18_02.htm:$time = ctime($time)Converts time, which is some number of seconds ch18_02.htm:FM-Command>echo($string)
Prints the given string. Any variables in the string will be replaced ch18_02.htm:fprintf($fd, $string [, arg ...])
Works like the C (or Perl) function of the same name. The first ch18_02.htm:$hostinfo = gethostbyaddr($address)
Returns the same array as gethostbyname() for ch18_02.htm:$hostinfo = gethostbyname($host)
Returns an array of information about the given host. The first ch18_02.htm:$pid = getpid()
Returns the process ID of the Lite program.
ch18_02.htm:$entry = getpwnam($username)Returns an array of information about the user with the username ch18_02.htm:$entry = getpwuid($UID)
Returns an array identical to that of getpwnam for ch18_02.htm:includeFile($filename)
This function includes the file filename into the ch18_02.htm:$result = kill($pid, $signal)
Sends the signal signal to the process ch18_02.htm:$result = link($file, $newlinkname)
Creates a `hard' link from file to ch18_02.htm:$result = mkdir($directoryname)
Creates a directory with the given name. If the operation is ch18_02.htm:$socket = msqlConnect($host)
Connects to the mSQL server on the host host. The ch18_02.htm:msqlClose($socket)
Terminates the connection identified by socket.
ch18_02.htm:msqlDataSeek($result, $location)This places the `pointer' for result ch18_02.htm:$string = msqlEncode($string)
This function returns a copy of string that is ch18_02.htm:$row = msqlFetchRow($result)
This function returns the next row of available data in ch18_02.htm:msqlFieldSeek($result, $location)
This changes the `pointer' of a result generated by ch18_02.htm:msqlFreeResult($result)
This frees any memory used by a result retrieved with ch18_02.htm:$result = msqlInitFieldList($socket, $database, $table)
This creates a table of information about the table ch18_02.htm:$databases = msqlListDBs($socket)
Returns an array of the names of all of the databases available on ch18_02.htm:$tableinfo = msqlListField($result)
Returns an array of information about the next field in the table ch18_02.htm:$tables = msqlListTables($socket, $database)
Returns an array of the names of the tables available on ch18_02.htm:msqlNumRows($result)
Returns the number of rows of data contained in the result ch18_02.htm:$result = msqlQuery($socket, $query)
This attempts to send to query query to the ch18_02.htm:$result = msqlSelectDB($socket, $database)
This function attempts to set the connection ch18_02.htm:$result = msqlStoreResult
Retrieves any data that was produced by the last ch18_02.htm:$fd = open($file, $mode)
This function opens the given file using the given mode and ch18_02.htm:$pid = getppid()
Returns the process ID of the process that is the parent of the Lite ch18_02.htm:printf($string [, arg, ... ])
This works like the C (or Perl) function of the same name. Variables ch18_02.htm:$data = read($fd, $length)
Read length number of bytes from the specified ch18_02.htm:$line = readln($fd)
Read the next line from the specified file descriptor.
ch18_02.htm:$data = readtok($fd, $token)Read data from the specified file descriptor until the token is ch18_02.htm:$result = rename($oldname, $newname)
This attempts to rename of the specified file (or directory) from ch18_02.htm:$result = rmdir($path)
This attempts to remove the given directory. If the operation is ch18_02.htm:setContentType($string)
This function overrides the default content type of HTML page ch18_02.htm:sleep($time)
This stops the program for time number of seconds.
ch18_02.htm:$strings = split($string, $token)Splits the given string by the token character into an array of ch18_02.htm:$stat = stat($file)
Returns an array of information about file. The ch18_02.htm:$time = strftime($format, $time)
This converts a Unix time into a text representation of the time ch18_02.htm:$string = strseg($string, $start, $end)
Returns the substring of the given string which starts at ch18_02.htm:$string = sub($string, $expr1, $expr2)
This substitutes any occurrences of expr1 in ch18_02.htm:$string = substr($string1, $regexp, $string2)
This finds the substrings of string1 that match ch18_02.htm:$result = symlink($file, $newlinkname)
This attempts to create a symbolic link from file ch18_02.htm:$result = system($command)
This function spawns a shell and executes command. ch18_02.htm:$result = test($test, $filename)
This performs the test test on the file ch18_02.htm:$time = time()
Returns the number of seconds since the epoch (00:00:00 GMT, Jan. 1, ch18_02.htm:$time = time2unixtime($sec, $min, $hour, $day, $month, $year)
This converts the values for a time into the Unix form of the time ch18_02.htm:$string = tr($string, $list1, $list2)
Substitutes all of the characters in list1 that ch18_02.htm:$result = truncate($file, $length)
This attempts to truncate the given file to length ch18_02.htm:umask($mask)
This sets the umask of the current process to ch18_02.htm:$sec = unixtime2sec($time)
These functions take a Unix time value and return the requested ch18_02.htm:$result = unlink("filename")
This deletes the specified file. If the operation is unsuccessful, a ch18_02.htm:$string = urlEncode($string)
This function returns a copy of string that is ch19_01.htm:
| mysql_affected_rows |
my_ulonglong mysql_affected_rows(MYSQL *mysql) |
Returns the number of rows affected by the most recent query. When ch19_01.htm:
| mysql_close |
void mysql_close(MYSQL *mysql) |
Ends a connection to the database server. If there is a problem when ch19_01.htm:
| mysql_connect |
MYSQL *mysql_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd) |
Creates a connection to a MySQL database server. The first parameter ch19_01.htm:
| mysql_create_db |
int mysql_create_db(MYSQL *mysql, const char *db) |
Creates an entirely new database with the given name. The return ch19_01.htm:
| mysql_data_seek |
void mysql_data_seek(MYSQL_RES *res, unsigned int offset) |
Moves to a specific row in a group a results. The first argument is ch19_01.htm:
| mysql_debug |
mysql_debug(char *debug) |
Manipulates the debugging functions if the client has been compiled ch19_01.htm:
| mysql_drop_db |
int mysql_drop_db(MYSQL *mysql, const char *db) |
Destroys the database with the given name. The return value is zero ch19_01.htm:
| mysql_dump_debug_info |
int mysql_dump_debug_info(MYSQL *mysql) |
This function causes the database server to enter debugging ch19_01.htm:
| mysql_eof |
my_bool mysql_eof(MYSQL_RES *result) |
Returns a nonzero value if there is no more data in the group of ch19_01.htm:
| mysql_errno |
unsigned int mysql_errno(MYSQL *mysql) |
Returns the error number of the last error associated with the ch19_01.htm:
| mysql_error |
char *mysql_error(MYSQL *mysql) |
Returns the error message of the last error associated with the ch19_01.htm:
Encodes a string so that it is safe to insert it into a MySQL table. ch19_01.htm:
| mysql_fetch_field |
MYSQL_FIELD *mysql_fetch_field(MYSQL_RES *result) |
Returns a MYSQL_FIELD structure describing the ch19_01.htm:
This function is the same as mysql_fetch_field, ch19_01.htm:
| mysql_fetch_fields |
MYSQL_FIELD *mysql_fetch_fields(MYSQL_RES * result) |
The function is the same as mysql_fetch_field, ch19_01.htm:
| mysql_fetch_lengths |
unsigned long *mysql_fetch_lengths(MYSQL_RES *result) |
Returns an array of the lengths of each field in the current row. A ch19_01.htm:
| mysql_fetch_row |
MYSQL_ROW mysql_fetch_row(MYSQL_RES *result) |
Retrieves the next row of the result and returns it as a ch19_01.htm:
Seeks to the given field of the current row of the result set. The ch19_01.htm:
| mysql_field_tell |
MYSQL_FIELD_OFFSET mysql_field_tell(MYSQL_RES *result) |
Returns the value of the current field position within the current ch19_01.htm:
| mysql_free_result |
void mysql_free_result(MYSQL_RES *result) |
Frees the memory associated with a MYSQL_RES ch19_01.htm:
| mysql_get_client_info |
char *mysql_get_client_info(void) |
Returns a string with the MySQL library version used by the client ch19_01.htm:
| mysql_get_host_info |
char *mysql_get_host_info(MYSQL *mysql) |
Returns a string with the hostname of the MySQL database server and ch19_01.htm:
| mysql_get_proto_info |
unsigned int mysql_get_proto_info(MYSQL *mysql) |
Returns the MySQL protocol version used in the current connection as ch19_01.htm:
| mysql_get_server_info |
char *mysql_get_server_info(MYSQL *mysql) |
Returns a string with the version number of the MySQL database server ch19_01.htm:
| mysql_info |
char *mysql_info(MYSQL *mysql) |
Returns a string containing information about the most recent query, ch19_01.htm:
| mysql_init |
MYSQL *mysql_init(MYSQL *mysql) |
Initializes a MYSQL structure used to create a ch19_01.htm:
| mysql_insert_id |
my_ulonglong mysql_insert_id(MYSQL *mysql) |
Returns the last number generated for an ch19_01.htm:
| mysql_kill |
int mysql_kill(MYSQL *mysql, unsigned long pid) |
Attempts to kill the MySQL server thread with the specified Process ch19_01.htm:
| mysql_list_dbs |
MYSQL_RES *mysql_list_dbs(MYSQL *mysql, const char *wild) |
Returns a MYSQL_RES structure containing the names ch19_01.htm:
Returns a MYSQL_RES structure containing the names ch19_01.htm:
| mysql_list_processes |
MYSQL_RES *mysql_list_processes(MYSQL *mysql) |
Returns a MYSQL_RES structure containing the ch19_01.htm:
| mysql_list_tables |
MYSQL_RES *mysql_list_tables(MYSQL *mysql, const char *wild) |
Returns a MYSQL_RES structure containing the names ch19_01.htm:
| mysql_num_fields |
unsigned int mysql_num_fields(MYSQL_RES *result) |
Returns the number of fields contained in each row of the given ch19_01.htm:
| mysql_num_rows |
int mysql_num_rows(MYSQL_RES *result) |
Returns the number of rows of data in the result set. This function ch19_01.htm:
| mysql_ping |
int mysql_ping(MYSQL *mysql) |
Checks to see if the connection to the MySQL server is still alive. ch19_01.htm:
| mysql_query |
int mysql_query(MYSQL *mysql, const char *query) |
Executes the SQL query given in the second argument. If the query ch19_01.htm:
Creates a connection with a MySQL database server. There are eight ch19_01.htm:
Executes the SQL query given in the second argument. The length of ch19_01.htm:
| mysql_reload |
int mysql_reload(MYSQL *mysql) |
Reloads the permission tables on the MySQL database server. You must ch19_01.htm:
| mysql_row_tell |
unsigned int mysql_row_tell(MYSQL_RES *result) |
Returns the value of the cursor used as ch19_01.htm:
| mysql_select_db |
int mysql_select_db(MYSQL *mysql, const char *db) |
Changes the current database. The user must have permission to access ch19_01.htm:
| mysql_shutdown |
int mysql_shutdown(MYSQL *mysql) |
Shutdown the MySQL database server. The user must have Shutdown ch19_01.htm:
| mysql_stat |
char *mysql_stat(MYSQL *mysql) |
Returns information about the current operating status of the ch19_01.htm:
| mysql_store_result |
MYSQL_RES *mysql_store_result(MYSQL *mysql) |
Reads the entire result of a query and stores in a ch19_01.htm:
| mysql_thread_id |
unsigned long mysql_thread_id(MYSQL * mysql) |
Returns the thread ID of the current connection. This value can be ch19_01.htm:
| mysql_use_result |
MYSQL_RES *mysql_use_result(MYSQL *mysql) |
Reads the result of a query row by row and allows access to the data ch19_02.htm:
| msqlConnect |
int msqlConnect ( char *host ) |
Creates a connection to the mSQL server whose hostname or IP address ch19_02.htm:
| msqlSelectDB |
int msqlSelectDB ( int sock , char *dbName ) |
Chooses a database for the specified connection. A database must be ch19_02.htm:
| msqlQuery |
int msqlQuery( int sock , char *query ) |
Executes the given SQL query. In mSQL 2, the return value is the ch19_02.htm:
| msqlStoreResult |
m_result *msqlStoreResult() |
Stores the result of a SELECT query. This function ch19_02.htm:
| msqlFreeResult |
void msqlFreeResult ( m_result *result ) |
Frees the memory associated with an m_result ch19_02.htm:
| msqlFetchRow |
m_row msqlFetchRow ( m_result *result ) |
Retrieves a single row of data from a result set. This data is placed ch19_02.htm:
| msqlDataSeek |
void msqlDataSeek ( m_result *result, int pos ) |
Sets the cursor that tells msqlFetchRow which row ch19_02.htm:
| msqlNumRows |
int msqlNumRows ( m_result *result ) |
Returns the number of rows in the result set.
ch19_02.htm:| msqlFetchField |
m_field *msqlFetchField ( m_result *result ) |
Returns the information about the fields in the result set. Each ch19_02.htm:
| msqlFieldSeek |
void msqlFieldSeek ( m_result *result , int pos ) |
Sets the cursor that tells msqlFetchField which ch19_02.htm:
| msqlNumFields |
int msqlNumFields ( m_result *result ) |
Returns the number of fields in the result set.
ch19_02.htm:| msqlClose |
int msqlClose ( int sock ) |
Closes the connection to the mSQL database server.
ch19_02.htm:| msqlListDBs |
m_result *msqlListDBs ( int sock ) |
Returns an m_result structure containing the names ch19_02.htm:
| msqlListTables |
m_result *msqlListTables ( int sock ) |
Returns an m_result structure containing the names ch19_02.htm:
| msqlListFields |
m_result *msqlListFields ( int sock , char *tableName ) |
Returns an m_result structure containing the names ch19_02.htm:
| msqlListIndex |
m_result *msqlListIndex ( int sock , char *tableName , char *index ) |
Returns an m_result structure containing ch21_02.htm:@available_drivers = DBI->available_drivers($quiet);
DBI::available_drivers returns a list of the ch21_02.htm:
DBI::bind_col binds a column of a ch21_02.htm:
DBI::bind_columns binds an entire list of scalar ch21_02.htm:
DBI::bind_param substitutes real values for the ch21_02.htm:
DBI::connect requires at least three arguments, ch21_02.htm:
| DBI::data_sources |
@data_sources = DBI->data_sources($dbd_driver); |
DBI::data_sources takes the name of a DBD module ch21_02.htm:$rows_affected = $db->do($statement, \%unused, @bind_values);
DBI::do directly performs a ch21_02.htm:
| DBI::disconnect |
$result = $db->disconnect; |
DBI::disconnect disconnects the database handle ch21_02.htm: $field_sep, $file_handle);
DBI::dump_results prints the contents of a ch21_02.htm:
| $DBI::err |
$error_code = $handle->err; |
$DBI::err returns the error code for the last DBI ch21_02.htm:
| $DBI::errstr |
$error = $handle->errstr; |
$DBI::errstr returns the error message for the ch21_02.htm:$rows_affected = $statement_handle->execute(@bind_values);
DBI::execute executes the SQL statement held in ch21_02.htm:
| DBI::fetchall_arrayref |
$ref_of_array_of_arrays = $statement_handle->fetchall_arrayref; |
DBI::fetchall_arrayref returns all of the ch21_02.htm:
| DBI::fetchrow_array |
@row_of_data = $statement_handle->fetchrow; |
DBI::fetchrow returns the next row of data from a ch21_02.htm:$array_reference = $statement_handle->fetch;
DBI:: fetchrow_arrayref and its alias, ch21_02.htm:
| DBI::fetchrow_hashref |
$hash_reference = $statement_handle->fetchrow_hashref; |
DBI::fetchrow_hashref works exactly like ch21_02.htm:
| DBI::finish |
$result = $statement_handle->finish; |
DBI::finish releases all data in the statement ch21_02.htm:
DBI::func calls specialized nonportable functions ch21_02.htm:$neat_string = DBI::neat($string, $maxlen);
DBI::neat takes as its arguments a string and an ch21_02.htm:$neat_string = DBI::neat_list(\@listref, $maxlen, $field_seperator);
DBI::neat_list takes three arguments and returns a ch21_02.htm:$statement_handle = $db->prepare($statement, \%unused);
DBI::prepare takes as its argument an SQL ch21_02.htm:
| DBI::quote |
$quoted_string = $db->quote($string); |
DBI::quote takes a string intended for use in an ch21_02.htm:
| DBI::rows |
$number_of_rows = $statement_handle->rows; |
DBI::rows returns the number of rows of data ch21_02.htm:
| DBI::state |
$sql_error = $handle->state; |
DBI::state returns the SQLSTATE ch21_02.htm:$handle->trace($trace_level, $trace_file);
DBI::trace is useful mostly for debugging ch21_02.htm:$result = $db->ping;
DBI::commit and DBI::rollback ch21_02.htm:$statement_handle->{type}
The DBI.pm API defines several attributes that may be set or read at ch21_03.htm:
| Msql::createdb |
$result = $db->createdb($database); |
Msql::createdb takes as its argument the name of a ch21_03.htm:
| Msql::database |
$database = $db->database; |
Msql::database returns the name of the current ch21_03.htm:
| Msql::dropdb |
$result = $db->dropdb($database); |
Msql::dropdb takes as its argument the name of a ch21_03.htm:
| Msql::errmsg |
$error = $db->errmsg; |
Msql::errmsg returns the last ch21_03.htm:
| Msql::getsequenceinfo |
($step, $value) = $db->getsequenceinfo($table); |
Msql::getsequenceinfo takes the name of a table as ch21_03.htm:
| Msql::host |
$host = $db->host; |
Msql::host returns the hostname of the database ch21_03.htm:
| Msql::listdbs |
@databases = $db->listdbs; |
Msql::listdbs returns an ch21_03.htm:
$fields = $db->listfields($table); |
Msql::listfields takes as an argument the name of ch21_03.htm:
| Msql::listindex |
@index_handles = $db->listindex($table,$index); |
Msql::listindex accepts the names of a table and ch21_03.htm:
| Msql::listtables |
@tables = $db->listtables; |
Msql::listtables returns an ch21_03.htm:
| Msql::query |
$query_output = $db->query($sql_statement); |
Msql::query is the most important and most ch21_03.htm:
| $Msql::QUIET |
The $Msql::QUIET variable, when true, turns off ch21_03.htm:$truncated_quoted_string = $db->quote($string,$length);
Msql::quote takes as its argument a scalar string. ch21_03.htm:
| Msql::selectdb |
$db->selectdb($database); |
Msql::selectdb selects a database from the ch21_03.htm:
| Msql::shutdown |
$result = $db->shutdown; |
Msql::shutdown sends a shutdown command to the ch21_03.htm:
| Msql::Statement::as_string |
$formatted_table = $statement_handle->as_string; |
Msql::Statement::as_string returns the data ch21_03.htm:Msql::Statement::dataseek
$statement_handle->dataseek($row_number); |
Msql::Statement::dataseek takes the number of a ch21_03.htm:
| Msql::Statement::fetchcol |
@column_of_data = $statement_handle->fetchcol($column_number); |
Msql::Statement::fetchcol takes the number of a ch21_03.htm:
%hash = $statement_handle->fetchhash; |
Msql::Statement::fetchhash ch21_03.htm:
| Msql::Statement::fetchrow |
@row_of_data = $statement_handle->fetchrow; |
Msql::Statement::fetchrow returns the next row of ch21_03.htm:
| Msql::Statement::isnotnull |
@not_null = $statement_handle->isnotnull; |
Msql::Statement::isnotnull returns a list of ch21_03.htm:
| Msql::Statement::isnum |
@numbers = $statement_handle->isnum; |
Msql::Statement::isnum returns a list of boolean ch21_03.htm:
| Msql::Statement::isprikey |
@primary_key = $statement_handle->isprikey; |
Msql::Statement::isprikey returns a list of ch21_03.htm:
| Msql::Statement::length |
@lengths = $statement_handle->length; |
Msql::Statement::length returns a list of the ch21_03.htm:
| Msql::Statement::listindices |
@indices = $statement_handle->listindices; |
Msql::Statement::listindices returns the indices ch21_03.htm:
| Msql::Statement::maxlength |
@max_lengths = $statement_handle->maxlength; |
Msql::Statement::maxlength returns a list of the ch21_03.htm:
| Msql::Statement::name |
@column_names = $statement_handle->name; |
Msql::Statement::name returns the names of the ch21_03.htm:
| Msql::Statement::numfields |
$number_of_fields = $statement_handle->numfields; |
Msql::Statement::numfields returns the number of ch21_03.htm:
| Msql::Statement::numrows |
$number_of_rows = $statement_handle->numrows; |
Msql::Statement::numrows returns the number of ch21_03.htm:
| Msql::Statement::table |
@tables = $statement_handle->table; |
Msql::Statement::table returns a list of the ch21_03.htm:
| Msql::Statement::type |
@column_types = $statement_handle->type; |
Msql::Statement::type returns the types of the ch21_03.htm:
| Msql::sock |
$sock = $db->sock; |
Msql::sock returns a scalar containing the number ch21_04.htm:
| Mysql::connect |
$db = Mysql->connect($host, $database, $user, $password); |
In addition to the three connect methods that are identical to ch21_04.htm:
| Mysql::errno |
$error_number = $db->errno; |
Mysql::errno returns the error number of the last ch21_04.htm: