Search found 34 matches

by transfield
Sun Nov 08, 2015 9:12 am
Forum: PHP - Code
Topic: Grab a File & Put It On My Server
Replies: 3
Views: 1043

Re: Grab a File & Put It On My Server

Wonderful help, I must say.

I had to change:

Code: Select all

$url  = "{$base_path}{$report_name}~{$district}~";
to

Code: Select all

$url  = "{$base_url}{$report_name}~{$district}~";


in order for it to work & after that it worked like a charm.

Thank you very much Celauran. God bless you :-)
by transfield
Sun Nov 08, 2015 7:41 am
Forum: PHP - Code
Topic: Grab a File & Put It On My Server
Replies: 3
Views: 1043

Grab a File & Put It On My Server

Hi, I'm using the following code to grab a csv file from one website & keep it on my website. The code is working fine. <?php $url = 'http://thewebsite.com/export.aspx?type=csv&report=nameofthereport~8~'; $path = '/home/path/to/mywebsite.com/public_ftp/incoming/nameofthereport_Area_8.csv'; $...
by transfield
Thu Mar 08, 2007 9:31 pm
Forum: PHP - Code
Topic: Do Some Calculations on Query Results
Replies: 26
Views: 2188

You problem is in your query that is executing inside the $i loop. The query never changes in the inner loop so you are forever getting the same median value. You are re-stating the obvious without providing a solution. Your code looks similar to mine but it performs worse than mine. Using your cod...
by transfield
Thu Mar 08, 2007 4:55 pm
Forum: PHP - Code
Topic: Do Some Calculations on Query Results
Replies: 26
Views: 2188

Show us the code you are using to calculate the median... Just to confirm it is correct. <?php $limit = "LIMIT 0,100000"; mysql_connect ("$host","$username","$password"); mysql_select_db($database) or die( "Where's the database man?"); if(isset($_PO...
by transfield
Thu Mar 08, 2007 3:58 pm
Forum: PHP - Code
Topic: Do Some Calculations on Query Results
Replies: 26
Views: 2188

It sounds like you want an average, which the MySQL AVG() function will give you. No, I don't want average. I want median. There is no formula / code for median in mysql so I created it myself. As I mentioned earlier, the method of calculating the median in my code is working correctly. All I need ...
by transfield
Thu Mar 08, 2007 2:56 pm
Forum: PHP - Code
Topic: Do Some Calculations on Query Results
Replies: 26
Views: 2188

Median is not average, mean is average. Median is the middle value in a sequence. Sorry for my confusion with your question. Here are some helpful MySQL manual pages that could help you out... MySQL Reference Index MySQL Group By (Aggregate) Functions No, this is not helpful. As I mentioned earlier...
by transfield
Thu Mar 08, 2007 2:50 pm
Forum: PHP - Code
Topic: Do Some Calculations on Query Results
Replies: 26
Views: 2188

Begby wrote:

Code: Select all

SELECT median(price) as priceMedian, full_add
FROM table0$j 
WHERE $email_str
GROUP BY full_add
tada!
There is no such thing as median(price) in Mysql.
by transfield
Thu Mar 08, 2007 12:29 pm
Forum: PHP - Code
Topic: Do Some Calculations on Query Results
Replies: 26
Views: 2188

So you want the median (the middle value of all values in ascending order). Is that right? No. I want the calculate the median price of each keyword individually. Let me explain the big picture here. I'm analysing the price trends of various cars on a yearly basis. Each table(table03, table06, etc)...
by transfield
Thu Mar 08, 2007 11:13 am
Forum: PHP - Code
Topic: Do Some Calculations on Query Results
Replies: 26
Views: 2188

Post back in plain simple English what you want the result to be The part that I do not know how to code & require your help is the median calculation is not looping through the search results. Therefore, instead of getting a result like Median Price from table03 Toyota - $3883 Honda - $356 Mer...
by transfield
Wed Mar 07, 2007 10:14 pm
Forum: PHP - Code
Topic: Do Some Calculations on Query Results
Replies: 26
Views: 2188

Instead of editing them offline you could always work on them locally then synchronize the two databases when finished.
I suppose that would be possible but it does not solve my problem anyway. I still would not know how to write the code. My question is, how do I write the code?
by transfield
Tue Mar 06, 2007 6:34 pm
Forum: PHP - Code
Topic: Do Some Calculations on Query Results
Replies: 26
Views: 2188

This seems to beg the question why are there multiple tables with the exact same structure? Good question you asked. Thank you. The reason is because the database size is very big. It is approximately 35 Mb x 4 tables = 140 Mb. I was having difficulty editing it offline & uploading it into my s...
by transfield
Tue Mar 06, 2007 4:58 am
Forum: PHP - Code
Topic: Do Some Calculations on Query Results
Replies: 26
Views: 2188

Hi Jenk,
How do I place each value into an array & where do I insert your code?

Thanks.
by transfield
Mon Mar 05, 2007 11:07 am
Forum: PHP - Code
Topic: Do Some Calculations on Query Results
Replies: 26
Views: 2188

Do Some Calculations on Query Results

Hello, I have got 4 tables in the same database. The name of the tables are table03 , table04 , table05 & table06 . The structure of the tables are exactly the same. I want to calculate the median price of the price column in each table individually based on the keywords I keyed in. The keywords...
by transfield
Tue Feb 20, 2007 6:09 am
Forum: PHP - Code
Topic: Sort Query Results
Replies: 8
Views: 1878

Thank you very much, Kieran Huggins. Yes, it works fine now. I appreciate your help.
by transfield
Tue Feb 20, 2007 5:05 am
Forum: PHP - Code
Topic: Sort Query Results
Replies: 8
Views: 1878

You mean like this? No it's still sorting the whole database instead of sorting only the query results from the 1st query. I don't want it to re-query & sort all the records in the whole database. I want it to sort only the query results from the 1st query. <?php $Text_Box_17 = $_POST['Text_Box_...