Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Count The Total Number Of MB Being Used


I`m building a small control panel for one of my sites and what I wanted to do was count the total number of MB being used, is it even possible in PHP and if so what would be the best method?




View Complete Forum Thread with Replies

Related Forum Messages:
Get A Total Count Of All Items
I am having a looping issue, when i execute this code I get a total count of all items at the end of each echo.. Code:

View Replies !
Count Total Iteration
I got stuck trying to count total iterations for two loops. My code is as follows:

for($i=1; $i<10; $i++){
echo $i;
for($j=1; $j<5; $j++){
echo $j;
}
}
it's gonna produce results as follows:
1 - 1,2,3,4
2 - 1,2,3,4
etc..

How to make this script output:
1,2,3,4,5,6,7..35,36?

View Replies !
Count Total Rows
I have a query and a loop where I output the results. Something like this:

PHP Code:
SELECT
     t1.var1,
     t1.var2,
     t2.var1,
     t2.var2
FROM t1
LEFT JOIN t2 ON (t1.id= t2.id)
WHERE
     t1.var1 = $value

I need to count what's the total number of rows I output.

View Replies !
Count Total Records.
I am currently displaying the Total number of Topics within a Forum, but I dont know how.

Each Topic is assigned to a Forum by inserting the Forum's id which is "ID", (located in forums table), and into a field named idforum, which is located in the topic_fr table.

Now that idforum has the id of the forum it has been inserted into, I can display these in each forum.

I have 2 forums, but I do not know how to display the total number of topics in each forum.

I was thinking something like this, but no.

$query = mysql_query("SELECT * FROM message_msg INNER JOIN forums ON idtop_msg=id WHERE idtop_msg='$id'");
$number=mysql_num_rows($query);
echo $number;

View Replies !
Getting Total Number Of Entries
Hello, Im trying to retrieve and echo the total amount of cars in the database with PHP Code:

View Replies !
Getting The Total Number Of Rows In SQL Database.
I know it's a bonehead question but what would a query in PHP look like that would return the total number of existing rows in a database.

View Replies !
Total Number Of Veiws Per Month
total number of veiws per month using the following PHP Code:

include 'config.php'
$db = mysql_connect($db_host,$db_user,$db_pass);
$profile = $_GET['user'];
mysql_select_db ($db_name) or die ("Cannot connect to database");
$result = mysql_query("SELECT user, month, COUNT(hits) AS count FROM weekly WHERE user='$profile' GROUP BY month") or exit(mysql_error());
while ($row = mysql_fetch_assoc($result))
{
    echo $row['user'] . '-'  . $row['month'] . '-' . $row['count'] . '  result(s)<br>'
    

}

View Replies !
The Total Number Of Searh Results
in the past when I've written searches they have been for small sites, I'm searching a site with around 120,000 entries on a database - its a full text search too

Ive realised a lot of the time wasted on the search comes from a mini query I do before I do the actual query. Because I only want to show 10 results per page I use the LIMIT in the query to take sections of the array.

But as this will only return 10 values I can't find out how many results i have in total using mysql_num_rows()! So i usually have a mini query above just selecting ID values which I use to grab the number of rows before conducting the actual query to collect the data with a set LIMIT.

This mini query just selecting ID values is taking a couple of seconds to execute, Does anyone know how I could just grab the number of results there would be if I didnt use the LIMIT function, without having to use an extra query?

View Replies !
How To Track The Total Number Of Logged In Members
I am currently working on a membership based web site. I need to display the number of members logged in that system. To do this I have set a flag in the database which is set to 1 whenever a user is logged in the system and when the user clicks on the ‘Log Out’ link a query is fired that sets the same flag to 0. To display the total number of logged in members I run a query that counts the number of records whose flag is set to 1.

However this method has a major shortcoming. When users do not click the ‘Log Out’ link but just close the browser. In such a situation the query that will set the flag field back to 0 will bot be fired and hence the user would be seen as active in the system even though the user has already left the system.

When one company is viewing the profile of another company in my site I also need to show whether that representative of the company whose profile is being viewed in logged in the system at that time or not so that if the user wants then can send a message to them.

I need some advice on how can I achieve this in the best possible way, where I can display the total number the total number of correct logged in members..

View Replies !
Pagination :: Loses Total Number Of Rows
I am having a bit of trouble getting my pagination to work correctly as there are some obstacles I have to work around in this specific script.

I have the script recognizing how many results there are, and it correctly displays the amount of pages there should be for the amount of data, but when I try to go to any other page than the first, it loses the rest of the rows and doesn't display anything.

Here is my code, I have narrowed it down as much as possible and deleted things you don't need to see so it is easier for you to look through. Code:

View Replies !
Can I Get Total Number Of Rows Form A Csv File
can I get the total number of rows in a csv file?

View Replies !
Mysql_fetch _array Total Number Rows Vs. Output
I am writing a script that needs to pull all users from a relational table. I would like to return the total number of users affiliated in the table but I would also like to limit the array fetched to a suitable number to be displayed on the screen (say.. 6).. Code:

View Replies !
Count The Number
I have been trying to figure out how to count the number of alphabets in a word. I searched a lot, but could not get any reference. Does php has any built in function to do that? I stumbled upon the sizeof() function, but it seems to count the number of words and not alphabets.

View Replies !
Count The Number Of Columns
I was wondering if there is a way to calculate the total of columns in a table? (something like $totalRows= mysql_num_rows($Recordset1); , but than for columns)

View Replies !
Count Number Of Folders.
How do you count the number of folders in a directory?

View Replies !
Number Count Beside Each Item
i need to list something which will be driven from mysql database and the output that i want to have is something like this.

1. item1
2. item 2
3. item3
4. item5

how can i generate the numbers 1. - 4. ..?

View Replies !
Count The Number Of Files
i want to do this.

if ( number of files in directory >= 1 ) { do this; }
else { do something else }.

View Replies !
How To Count Number Within A DB Field
I am trying to count how much money a person has won and i cant find the right forumula for it. Here's an example:

TABLE_MONEY
>>ID
>>DATE
>>NAME
>>MONEY_WON

ID DATE NAME MONEY_WON
1 4/1 Jon 50.00
2 4/1 Tim 20.00
3 4/2 Jon 10.00
4 4/2 Tm 15.00

could someone show me a code that would tell me how much money Jon and Tim made? or a link to an example (if it's to complex)

View Replies !
Count Number Of Records More Than Zero
I would like to check if the number of records is more than zero. $sql = "SELECT count(*) FROM Hardware WHERE Location = '$location'"; how to continue from the above statement?

View Replies !
Count Number Of Entries
i have a table in my database called "THREAD" and where a row is called FORUMID. i'd like to show how many entries in this table have FORUMID set to 47. could anyone please hook me up with a code that could do that?

View Replies !
Count Number Of Rows XML?
I need to be able to count the number of rows that an XML response contains, here is the code that receives the XML response: Code:

View Replies !
Count Number Of Links
would anyone be able to think of a way to count how many http links are inside a string variable? I'm getting spam to my sites and it's a constant uphill battle, constaly blocking keywords etc, it seems more logical to simply block emails that send me more than 3 links via my form.

the only time someone sends me 3 links it's random bullshit spam with nonsense words and links. perhaps this method of blocking would work for others on their comment systems or mails forms as well.

View Replies !
Count Number Of XX In Table
I have users table with a 'state' field that includes items such as Inactive, Dead, Trading, etc. How would I query that table to count up the number of users that are classified as Dead, or Inactive?

View Replies !
Count Number Of Rows
Ive got a table called course_login which takes the staff_id, course_id, ip and login_date of every time a user logs into my system. I want to count how many times a certain user has logged in and when the last login was. Therefore would I do something like this to get the amount of times.

"SELECT COUNT(course_login_id) AS num FROM course_login WHERE staff_id = $iStaffId";

Not too sure what the best way is to get the latest one.

View Replies !
Count Number Of Columns
I need to know the number of columns in a table (which equals the number of fields in the first row.

$result = mysql_query($query) or die ("Error in query: $query. " .
mysql_error());
while ($row = mysql_fetch_row($result))
{
foreach ($row as $item)
$counter=++$i;
}
echo $counter;

View Replies !
Count The Number Of Words Written.
I have a form which users can write a letter and outputs it as $letter - done this, but I need something to count the number of words written.

View Replies !
Count The Number Of Peoples In A Region
I've ever the same problem.

Table1
idperson, name, zip

table2
zip, city, region.

Table2: same zip, many cities (1000, Lausanne - 1000, Lausanne1, ...)

Now I'd like ONE query wich return the name, zip and city, but just one
record per zip.

I mean if a record in table1 has zip 1000, I only want the first occurence
of the city (in my case Lausanne).
Actually I get as many records as they are cities with the same zip.

namex,1000,Lausanne
namex,1000,Lausanne1
namex,1000,LausanneN....

How to do so ? in fact what I need is count the number of peoples in a
region, and the region is linked to a zip.

1000, Lausanne, VD
1000, Lausanne1, VD....

the actual query is
select count(idperson), region from table1 inner join table2 on table1.zip =
table2.zip group by region.

View Replies !
Count The Number Of Names In A Field
I want to count the number of names in a field to a web page. I use the following line to gather the data and store to a variable:

$tally=mysql_query("SELECT count(*) FROM fname",$db);

I use the next line to post it: print $tally;

The output on the web page should be the number of rows counted in the field but I get:
Resource id #2 .

View Replies !
Count The Number Of Records In A Table
I just want to count the number of records in a table that meet a certain set of conditions: Getting an error: Warning: mysql_result(): supplied argument is not a valid MySQL result resource code:

View Replies !
Count Number Of Items In Each Category
I'm trying to list my categories and how many items are in each
category. I'm not much on sub queries. How can I combine these two
items. I'd like to display the category and the corresponding number of
items in each ....

View Replies !
Count The Number Of Elements In An Array
When I try to count the number of elements in an array (stored in a session array), I can't get it to work. The elements are all present, as when I echo the contents it prints 1, 2, 3, 4 - but when I try counting this it always returns 1. The contents of the session are being brought forward from a previous page, and when I use exactly the same code on that page I get the correct count of 4. Any idea why this would be failing? Code:

View Replies !
Count Number Of Records Returned
I want to know how many records were returned from a stored procedure.

$rs=odbc_exec($conn,"EXEC select_Contacts ".$sessionID);

I have tried: odbc_num_rows($rs) but it always returns -1 even though records are printed out.

View Replies !
Count The Number Of Files (.jpg) In A Folder
i need to be able to count the number of files (.jpg) in a folder and should display all images. why?

View Replies !
Count The Number Of Occurences Of Pages
i have two tables both holding similar info(trust me its been normalized as far as pos) anyway i query table1 and get results with headings:

id, page

i then query table2 and get a table with id and page. how can i add the rows together (union removed suplicates). I want to do this so i can count the number of occurences of pages. I can do this easy its just the adding of the rows together?

View Replies !
Count Number Of Entries In A Directory ?
is it possible to obtain the number of entries in a directory without enumerate it with opendir() function ?

View Replies !
+count Up A Number From A Mysql Results
Ok I have the code below to make a top 100 user list what I would like to do though is have it count up like show there rank number as

1
2
3

all the way to 100 Code:

View Replies !
Count The Number Of Days Between Two Date Variables?
I would like to have a variable with a set date go against the current date, and determine the number of days between the two dates.?

View Replies !
Function To Count Number Of Lines In File
Is There A Function To Count Number Of Lines In File?

View Replies !
Count Displaying Multiple 0 Instead Of Actural Number
I've been having this problem with the count, i've had it working for the other page, but that one uses a ID tag of 1 - 50. This one uses a jcode thats constantly changing. PHP Code:

View Replies !
Count The Number Of Times A Page Is Viewed?
can PHP count the number of times a page is viewed? Doesnt have to be unique views.
Wish to insert this in a db.

View Replies !
Count Number Of Days In Db By Date Listed...
I have a table with entries and a date stamp in mm/dd/yyyy format. I want to count how many days there were but only counting 1 day if there are say 20 entries for one specific day! In other words lets say there are:

10 entries for 10/05/2007
and
5 entries for 10/10/2007
The count should result as 2 days.

I have tried while loops but they keep causing the browser to not load the page. Here is an example of what I've tried: Code:

View Replies !
Create A SQL Query To Count The Number Of Votes
I have created a voting system in PHP in which visitors can vote for any of 1000 companies. I wish to create a SQL query to count the number of votes for each company and list the 20 highest and state the number of votes they received. Please can someone give me a little guidance on how I can do this?

View Replies !
Count The Number Of Lines Of A Entry In A Table
could anyone give me a code to display the number of lines in the row "THREADPREFIX" of my "FORUM" table.

View Replies !
Count The Number Of Images In A String From A Cms Editor.
i need to count the number of images in a string from a cms editor. like the editor will return stuff like

<p><img title="" height="360" alt="" src="http://www.mysite.com/images/oh-no.jpg" width="229"></p><p><img title="" height="360" alt="" src="http://www.mysite.com/images/oh-no.jpg" width="229"></p><p><img title="" height="360" alt="" src="http://www.mysite.com/images/oh-no.jpg" width="229"></p><p><img title="" height="360" alt="" src="http://www.mysite.com/images/oh-no.jpg" width="229"></p>

and i need to count the number of images that are in there. there are 4 in there and i can only get one returned with preg_math_all for some reason. anyone help me with a expression that will return 4 images? the images are variable so the expression needs to be on the <img > tag.

View Replies !
How To Count The Number Of Times A Link Is Visited
how i can get the total number of times a particular link has been visited.for example:this is the link. www.abcd.com/upload.php?id=761786717.jpg. i want to display how many times this link has been visited.

View Replies !
Count The Number Of Matches And Assign A Variable For Each One
I've been trying to work out a problem but I'm having no luck. I have
field in my table for area and I need to count the number of matches
and assign a variable for each one.. this is what I have but it doesn't
work.. any ideas? Code:

View Replies !
Count The Number Of Words Appearing In Website
I need to count the number of words appearing in website. For example, in google.com i need to find out how many words are repeating and how many times and also we have to take care of special words like John and John's.

View Replies !
Count The Number Of Words In A Microsoft Word Document
I need to count the number of words in a microsoft word document. I have search the internet and so far no good. Anyone have any ideas?

View Replies !
Count The Number Of Times A Field Equals A Specific Value
Is it possible to count the number of times, for example, the field 'result' equals "won"?

View Replies !
Count,sort,diplay Number Of Records In MySQL Table
I am designing a search engine using PHP/MySQL and I am logging all search terms into a MySQL table. I was wondering how I count the number of occurences of a term in the table, and then sort and display the terms in descending order. For example, if the column in my table with search terms looked something like this:

clothes
casinos
clothes
homes
homes
clothes

How can I count and order the records so that I can display according to how many times they appear, like so:

1. clothes(3 entries)
2. home(2 entries)
3. casinos (1 entry)

View Replies !
Add Hits To Get A Total Number Of Hits
I have a database of images each which gets it own number of hits.
how do i then 'add ' all these hits together to get a total number of hits?

SELECT *, COUNT(hits) FROM photos GROUP BY hits DESC LIMIT 5

is my attempt but i know its wrong

View Replies !
How Do I Make Php/mysql Count The Number Of "e" In A Column.
I'm good at php but haven't coded anything in mysql/php for overa month now. I hope you can help me. What I essentially want to do, is calculate the number of "e" / "u" / "p" in each column. I don't need helping echoing the results, I just need help in the mysql coding part. How do I make php/mysql count the number of "e" in a column.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved