MYSQL

Free MySQL Classes for PHP Mysql database classes, Php functions for Mysql

mysql_create_db

mysql_create_db — Create a MySQL database
Version:
(PHP 4, PHP 5)
Syntax:
bool mysql_create_db  ( string $database_name [,resource $link_identifier])
Description:
mysql_create_db() attempts to create a new database on the server associated with the specified link identifier.
database_name
The name of the database being created.
link_identifier
The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no [...]

mysql_connect

mysql_connect — Open a connection to a MySQL Server
Version:
(PHP 4, PHP 5)
Syntax:
mysql_connect($server,$user,$password,$newlink,$clientflag)
Description:
The mysql_connect() function opens a non-persistent MySQL connection.
server
     The server is a String. It can also include a port number. e.g. “hostname:port” or a path to a local socket e.g. “:/path/to/socket” for the localhost.
user
  User is a String containing the user name. Default value [...]

mysql_close

mysql_close — Close MySQL connection
Version:
(PHP4, PHP5)
Syntax:
bool mysql_close  ([ resource $link_identifier  ] )
Description:
The mysql_close() function closes a non-persistent MySQL connection.
$link_identifier
Optional. Specifies the MySQL connection to close. If not specified, the last connection opened by mysql_connect() is used.
Return Values:
Returns TRUE on success or FALSE on failure.
Example mysql_close():

 

<?php

$con = mysql_connect("localhost","user","password");

if (!$con)

  {

  die(‘Could not connect: ‘ . mysql_error());

  [...]

mysql_client_encoding

mysql_client_encoding — Returns the name of the character set
Version:
(PHP 4 &gt;= 4.3.0, PHP 5)
Syntax :
string mysql_client_encoding  ([resource $link_identifier])
Description :
The mysql_client_encoding() function returns the name of the character set for the current connection.
$link_identifier
Optional. Specifies the MySQL connection. If not specified, the last connection opened by mysql_connect() or
mysql_pconnect() is used.
Return Values:
Returns the default character set name for [...]

mysql_change_user

mysql_change_user — Change logged in user of the active connection
Syntax :
int mysql_change_user ( string $user , string $password [, string $database [, resource $link_identifier]] )
string user: Username to log in with
string password: Password to use
string database (optional): Default database to use for queries
Description :
mysql_change_user() changes the logged in user of the current active connection, or [...]

mysql_affected_rows

mysql_affected_rows() : Returns the number of affected rows in the previous MySQL operation.
Version :
(PHP 3, PHP 4, PHP 5)
Syntax :
int mysql_affected_rows ([ resource $link_identifier ] )
Description :
mysql_affected_rows() returns the number of rows affected by the last INSERT, UPDATE or DELETE query associated
with link_identifier.
This function returns the number of affected rows on success, or -1 if [...]

Mysql Database class for Php 5.0

Very useful Mysql Script for PHP 5.0. It will allow to do the following:
Connect to a mysql database - Query a mysql database to include * INSERT|DELETE|UPDATE|REPLACE|DROP * SELECT|SHOW|DESCRIBE|EXPLAIN - Catch errors and email them to the admin - Check variables to make sure they only contain particular characters All errors are in the file [...]