Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Thursday, November 13, 2014

Copy the script shown below into a .php file, replacing the hostname, database, username, and password with your Database Name and your password, etc., then upload the file to your webspace. This script is only for connecting to MySQL. Additional commands will need to be added manually


php tutorials freeCopy the script shown below into a .php file, replacing the hostname, database, username, and password with your Database Name and your password, etc., then upload the file to your webspace. This script is only for connecting to MySQL. Additional commands will need to be added manually

<?php

//ENTER YOUR DATABASE CONNECTION INFO BELOW:
$hostname="db1111111111.db.1and1.com";
$database="db1111111111";
$username="dbo111111111";
$password="myPassword";

//DO NOT EDIT BELOW THIS LINE
$link = mysql_connect($hostname, $username, $password);
if (!$link) {
die('Connection failed: ' . mysql_error());
}
else{
     echo "Connection to MySQL server " .$hostname . " successful!
" . PHP_EOL;
}

$db_selected = mysql_select_db($database, $link);
if (!$db_selected) {
    die ('Can\'t select database: ' . mysql_error());
}
else {
    echo 'Database ' . $database . ' successfully selected!';
}

mysql_close($link);
?>


Monday, November 3, 2014

Simple Banner Rotator With PHP, jQuery & MySQL

Simple Banner Rotator With PHP, jQuery & MySQL
In this tutorial we are making a simple PHP, jQuery & MySQL banner
 rotator, with which you can create and randomly display banners on
 your site. Each of the banners features a neat jQuery animation effe
ct, which you can customize to fit your own needs. Read more..