• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Just how much data-transfer do MySQL queries take up?

agiantdwarf

New Member
I've been wondering. While thinking about writing a few scripts, I
was thinking about bandwidth. I wondered, if you had a table that contained 10,000 rows, each with a 10 byte word, plus 10 bytes of other data, when doing a "select * from table" query, how much data-transfer is that? About 200 kb (10000b * 20b)?

I am wondering this because I am thinking about writing a script that will use Javascript to query a very small table every 10 seconds.
 
Since query's are server side it wouldnt matter
only when displaying the info is there any transfer
 
Originally posted by Christopher
lol, he seems happy :biggrin2:


You can use javascript to quary a database :confused:
No, no. What you can do is some code like this (I don't know Javascript that well, excuse me)

<SCRIPT LANGUAGE="javascript">
function query(){
<?php
//query the db
?>
}
setTimeout(query(),10000);
</SCRIPT>
 
If your using windows you could do a scheduled task
or do this
PHP:
<?
$dbuser="Database User";
$dbpass="Database Password";
$dbname="database name";

$link_id = mysql_connect('localhost', $dbuser, $dbpass) ;
mysql_select_db('dbname', $link_id);
$query = "Bah Blah";
$result = mysql_query($query) or die(mysql_error());
?>
<HTML>
<HEAD>
<META HTTP-EQUIV="Refresh" CONTENT="10;URL=http://www.watever.com/page/page.php">
</HEAD>
<?

That will run every 10 seconds
and as long as people dont run it from the web no bandwidth is used
 
Back
Top