TMP Int.

TMP Int.


Music from the Coffee Lands


Music from the Coffee Lands


$6.98


VARIOS INTERPRETES MUSIC FROM THE COFFEE LANDS…

Intermatic PA122 Pool/Spa Thermostat Control with Probe


Intermatic PA122 Pool/Spa Thermostat Control with Probe


$35.35


The Intermatic PA122 Water Temperature Sensor installs in the inlet side of the heater and monitors both pool and spa water temperature, depending on the position of the diverter valves. Installation is necessary for the thermostatic control to work. The…

McFarlane Toys MLB Sports Picks Series 25 (2009 Wave 2) Action Figure Josh Hamilton (Texas Rangers) Blue Jersey


McFarlane Toys MLB Sports Picks Series 25 (2009 Wave 2) Action Figure Josh Hamilton (Texas Rangers) Blue Jersey


$42.99


McFarlane’s Sports Picks delivers MLB 25. This classic six-figure lineup features five players making their Sports Picks debuts….

Spawn - 1994 - Tremor Action Figure - Includes Special Edition Comic Book - Spring Loaded Fist Action - Limited Edition - Vintage - Mint - Collectible


Spawn – 1994 – Tremor Action Figure – Includes Special Edition Comic Book – Spring Loaded Fist Action – Limited Edition – Vintage – Mint – Collectible


$1.23


Packaged, Never has been opened. Loose head came un-done….

McFarlane Toys MLB Series 25 Sports Picks Action Figure - Mark Teixeira


McFarlane Toys MLB Series 25 Sports Picks Action Figure – Mark Teixeira


$49.00



Ten Stupid Things Women Do to Mess Up Their Lives


Ten Stupid Things Women Do to Mess Up Their Lives


$2.76


Dr. Laura Schlessinger is the incredibly popular and controversial psychotherapist who hosts a nationally syndicated, top-rated midday radio talk show. She has strong convictions and doesn’t hesita…

The Wounded Heart: Hope for Adult Victims of Childhood Sexual Abuse


The Wounded Heart: Hope for Adult Victims of Childhood Sexual Abuse


$3.68


Sexual abuse not only destroys trust, relationships, and dreams, it also causes grief, stress, and feelings of guilt and shame. This book examines the issues surrounding sexual abuse while looking to God for restoration and peace.• Includes information about false memory issues• Indexed for easy reference• Also available: The Wounded Heart Workbook…

Switchblade Honey


Switchblade Honey


$4.83


The alien Chasta put their war machine into gear and humankind was suddenly in the worst fight it had ever known – and lost. The solar system will be annexed by the Chasta within the next thirty days. If humankind can’t be the U.S. Army anymore, then it will have to be the Viet Cong. Disgraced Captain John Ryder gets a ship and crew and leads them into space as guerrilla fighters. Once clear of th…


Get Files From Remote File Size With PHP

Original source : Get Files From Remote File Size With PHP

To get the file size of local files in PHP, we can use the filesize () (http://php.net/manual/en/function.filesize.php), the function will produce the size of the requested file in bytes size. Unfortunately, these functions can not be used on remote files, or files which are beyond our servers. There are several ways you can use to read the file size of remote files using basic functions exist in PHP.

The First Method
The first way is to use curl (http://curl.haxx.se/). With this function we first read the whole remote file or in other words we download it in advance and stored in the tmp folder. Generally these functions have been found on engines PHP> 5.

[php]
$url    = ‘http://www.google.com/intl/en_ALL/images/srpr/logo1w.png’;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$site = curl_exec($ch);
curl_close($ch);

if (preg_match(‘/Content-Length: (d+)/’, $site, $matches)) {
$contentLength = (int)$matches[1];
}

echo $contentLength; // size of Google logo in bytes
[/php]

Get File Size From Remote File With PHP

The Second Method (The Best and Fastest!)
The second way is to use get_headers function (), which was introduced since PHP version 5, so if you’re still using PHP version 4, then you can not perform this function. With this function, your server does not need to download the entire file, making it very fast and saves your servers resources.

[php]
Original source : Get Files From Remote File Size With PHP
[/php]

Hopefully this short article could help you and can solve problems in reading a remote file :)

Original source : Get Files From Remote File Size With PHP

About the Author

Founder of Buzzknow

My other site

Remote Wireless Speakers Online Degree Higher Education

CoD MW2 INt€rVe€ntTioN

TMP Int.

When I’m developing PHP applications I normally have a DOS window open so I can run SQL scripts from the command line. Often, this is so I can check that MySQL database tables are being updated correctly while I am running PHP scripts.

There are not that many command line tasks I need to perform, but it is useful to be able to run them as and when I need to. In this tutorial I’ll look at a few MySQL commands I find really useful during the development of PHP applications.

Logging onto the MySQL monitor

To log onto the MySQL monitor:

  1. Open a command prompt window, and navigate to the the mysqlbin folder.
  2. Run the command:

mysql

OR

mysql -u user -p

If prompted, enter the password for the database user.

Setting a root password

If you have not got a root password set, here is how you set one.

  1. Log onto the MySQL monitor as described above.
  2. Run the command:

set password for root@localhost=password(‘password‘);

Updating a table

I quite often need to add or delete new columns, or modify existing ones.

To perform the following commands you need to be logged onto the MySQL monitor, as described above.

Adding a new column

The format is:

ALTER table tablename

ADD new_column type

AFTER column;

And here are a couple of examples:

ALTER table users

ADD surname char(30)

AFTER firstname;

ALTER table users

ADD age int (2) NOT NULL default ‘0′

AFTER surname;

Modifying an existing column

Sometimes it is necessary to update existing columns; here is the format:ALTER table tablename

MODIFY column type;

And here’s an example:

ALTER table users

MODIFY age int (3) NOT NULL default ‘0′;

Dropping a column

Here’s the format:ALTER table tablename

DROP column;

And here’s an example:

ALTER table users

DROP age;

Dumping the contents of a database into an SQL file

For backup purposes, if nothing else, it’s sometimes useful to dump all the contents of a database into an SQL file. Here’s how you do it:

  1. Open a command prompt window, and navigate to the the mysqlbin folder.
  2. Run the command:

mysqldump -u database_user_name -p database_name > database_name.sql

When prompted, enter the password for the database user.

Sending the output from an SQL query to a file

Sometimes it is useful to send the output from a query to a file, for example, a text file. Here is an example of how to do it.

  1. Log onto the MySQL monitor.
  2. Run the SQL query, for example:

SELECT name,surname FROM users into outfile ‘/tmp/users.txt’;

About the Author: John Dixon is a web developer working through his own company John Dixon Technology Limited. The company also develops and supplies a free accounting bookkeeping software tool called Earnings Tracker. The company’s web site contains various articles, tutorials, news feeds, and a finance and business blog.

Leave a comment

Your comment