August 24, 2008 at 1:37 pm
· Filed under PHP Programming, mysql, php, php help, programming, web-apps ·Tagged mysql, php, PHP Programming, programming, web-apps
mysql_close

Glad to Help you !
php mysql_close function
Returns TRUE on success or FALSE on failure.
<?php
$link_to_database = mysql_connect(‘localhost’, ‘username’, ‘password’); //
if (!$link_to_database) { // checking connection
die(‘Could not connect: ‘ . mysql_error());
}
echo ‘Connected successfully’; // Display Message when connection is sucessfully done
mysql_close($link); // This function will close the mysql connection
?>
best php help system
Permalink
August 24, 2008 at 9:53 am
· Filed under PHP Programming, mysql, php, php help, programming, web-apps ·Tagged mysql, php, php help, PHP Programming, programming, web-apps
mysql_client_encoding
php mysql_client_encoding function
mysql_client_encoding Return : Returns the default character set name for the current connection.
<?php
$database_link = mysql_connect(‘localhost’, ‘username’, ‘password’);
$what_is_charset = mysql_client_encoding($database_link);
echo “Your current character set is: $what_is_charset\n”;
// Output : Your current character set is: latin1
?>
good php help resource !
Permalink
August 23, 2008 at 3:56 pm
· Filed under PHP Programming, mysql, php, php help, php-coder, programming ·Tagged mysql, php, php help, PHP Programming, php-coder, programming
mysql_change_user
php mysql_change_user function
<?php
$old_user = ‘username’;
$new_user = ‘newusername’;
$link = mysql_connect (‘hostname’,$old_user,’password’);
if (mysql_change_user ($old_user, $new_user)) {
echo “User changed to <b>$new_user</b>.”;
} else {
echo “User could not be changed to <b>$new_user</b>.”;
}
?>
Permalink
August 23, 2008 at 3:33 pm
· Filed under PHP Programming, mysql, php, php help, php-coder, programming ·Tagged mysql, php, php help, PHP Programming, php-coder, programming
mysql_affected_rows
php mysql_affected_rows function
mysql_affected_rows Get the number of affected rows by the last INSERT, UPDATE, REPLACE or DELETE query.
<?php
$link = mysql_connect(‘localhost’, ‘username’, ‘password’);
if (!$link) {
die(‘Could not connect: ‘ . mysql_error());
}
mysql_select_db(‘mydb’);
// This will return the number of records deleted
mysql_query(‘DELETE FROM table WHERE fldid < 100′);
print “Records Deleted By Above Query: “. mysql_affected_rows();
// Output will be like this : Records Deleted By Above Query: 10
?>
Permalink
August 23, 2008 at 12:39 pm
· Filed under php ·Tagged php
strripos
php strripos function
<?php
$haystack = ‘ababcd’;
$needle = ‘aB’;
$pos = strripos($haystack, $needle);
if ($pos === false) {
echo “Sorry, we did not find ($needle) in ($haystack)”;
} else {
echo “Congratulations!\n”;
echo “We found the last ($needle) in ($haystack) at position ($pos)”;
}
?>
Permalink
August 22, 2008 at 6:27 pm
· Filed under php ·Tagged php
mysql_errno
php mysql_errno function
Returns the error number from the last MySQL function, or 0 (zero) if no error occurred.
<?php
$link = mysql_connect(”localhost”, “mysql_username”, “mysql_password”);
mysql_select_db(”nonexistentdb”, $link);
echo mysql_error($link);
// output of this echo will be: 1049
// error no 1049 is for database not exist
?>
Permalink
August 22, 2008 at 5:25 pm
· Filed under php ·Tagged php
mysql_error
php mysql_error function
<?php
$link = mysql_connect(“localhost”, “mysql_username”, “mysql_password”);
mysql_select_db(“nonexistentdb”, $link);
echo mysql_error($link);
// output of this echo will be: Unknown database ‘nonexistentdb’
mysql_select_db(“existentdb”, $link);
mysql_query(“SELECT * FROM nonexistenttable”, $link);
echo mysql_error($link);
// output of this echo will be: Table ‘existentdb.nonexistenttable’ doesn’t exist
?>
php help system
Permalink
August 22, 2008 at 3:39 pm
· Filed under Uncategorized ·Tagged php, php Tutorials
mysql_close
php mysql_close function
<?php
$link = mysql_connect(‘localhost’, ‘mysql_username’, ‘mysql_password’); // This line will open a mysql database connection
mysql_close($link); // this function will colse the above mysql connection
?>
Permalink
August 22, 2008 at 2:52 pm
· Filed under Uncategorized ·Tagged php, php help, PHP Programming, php Tutorials
mysql_connect
php mysql_connect function
mysql_connect — Open a connection to a MySQL Server
This php function is used to connect to mysql database , mysql_connect function required three main parameters host name , database username and database password.
<?php
mysql_connect( ‘localhost’, ‘dbuser’, ‘dbpass’) or die(‘Could not connect to mysql server.’ );
?>
Returns a MySQL link identifier on success, or FALSE on failure.
php help is the biggest php resource
Permalink
August 22, 2008 at 9:11 am
· Filed under Uncategorized ·Tagged php, php date, php doc, php forum, php help, php include, php login, PHP Programming, php script, php template, php Tutorials, php url, php web, read php
setcookie
php setcookie function
<?php
$value_in_cookie = ‘test test’;
setcookie(“Test_Cookie”, $value_in_cookie);
setcookie(“TestCookie”, $value_in_cookie, time()+3600); /* expire in 1 hour */
setcookie(“TestCookie”, $value_in_cookie, time()+3600, “/test-path/”, “.test.com”, 1);
?>
good php help blog for php functions , php coding , php scripts
Permalink
Older Posts »