Welcome Guest ( Log In | Register )



2 Pages V   1 2 >  
Closed TopicStart new topic
> What Is The MySQL Version @ Asta ?, MySQL 4.0.26-Max
faulty.lee
post Nov 21 2006, 07:42 AM
Post #1


Super Member
Group Icon

Group: [HOSTED]
Posts: 500
Joined: 5-November 06
Member No.: 17,016
myCENTs:NEGATIVE[-20.12]



Hi,

A few question here,

1. Just wondering, the MySQL hosted on astahost.com is actually version "4.0.26-Max" according to phpmyadmin. But why is cPanel showing "4.1.21-standard"?

2. Actually i've existing codes that need function introduced after version 4.1.1, is there by any chance astahost or xisto is going to upgrade the MySQL package?

Thanks
Go to the top of the page
 
+Quote Post
TavoxPeru
post Nov 22 2006, 03:42 AM
Post #2


Super Member
Group Icon

Group: [HOSTED]
Posts: 805
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579
myCENTs:46.87



QUOTE(faulty.lee @ Nov 21 2006, 02:42 AM) *

Hi,

A few question here,

1. Just wondering, the MySQL hosted on astahost.com is actually version "4.0.26-Max" according to phpmyadmin. But why is cPanel showing "4.1.21-standard"?

2. Actually i've existing codes that need function introduced after version 4.1.1, is there by any chance astahost or xisto is going to upgrade the MySQL package?

Thanks

Hi,

In my case cPanel shows that i have MySql version 4.0.27-standard but according to phpMyAdmin i have 4.0.26-Max, its very strange, may be an admin can tell us why exists this differences.

Best regards,
Go to the top of the page
 
+Quote Post
faulty.lee
post Nov 22 2006, 04:21 AM
Post #3


Super Member
Group Icon

Group: [HOSTED]
Posts: 500
Joined: 5-November 06
Member No.: 17,016
myCENTs:NEGATIVE[-20.12]



Hi,

I have another question. My web page needs to use a few mysql function that's introduce after v4.1.1, since our hosting only provide v4.0.26, just wondering is there any alternative function for :
1. DATEDIFF
2. TIMEDIFF
3. ADDTIME
4. SUBTIME

Most important is actually TIMEDIFF. I've googled and no result. Really sad, never thought that i'll actually use a function that's not available in common hosting server sad.gif
Go to the top of the page
 
+Quote Post
Ed :P
post Nov 22 2006, 04:29 AM
Post #4


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 63
Joined: 28-August 06
Member No.: 15,585



QUOTE(faulty.lee @ Nov 22 2006, 04:21 AM) *

Hi,

I have another question. My web page needs to use a few mysql function that's introduce after v4.1.1, since our hosting only provide v4.0.26, just wondering is there any alternative function for :
1. DATEDIFF
2. TIMEDIFF
3. ADDTIME
4. SUBTIME

Most important is actually TIMEDIFF. I've googled and no result. Really sad, never thought that i'll actually use a function that's not available in common hosting server sad.gif

Those don;t sound like functions but board names. If google can't help you, and they've cached all of the mysql handbook then there minor, changable things. Decipher the php (i assume) your using and just figure out how they work. If all else fails, follow original instructions completly.
Go to the top of the page
 
+Quote Post
faulty.lee
post Nov 22 2006, 04:48 AM
Post #5


Super Member
Group Icon

Group: [HOSTED]
Posts: 500
Joined: 5-November 06
Member No.: 17,016
myCENTs:NEGATIVE[-20.12]



QUOTE(Ed :P @ Nov 22 2006, 12:29 PM) *

Those don;t sound like functions but board names. If google can't help you, and they've cached all of the mysql handbook then there minor, changable things. Decipher the php (i assume) your using and just figure out how they work. If all else fails, follow original instructions completly.


Those are MySQL's functions. I wrote the web software myself. It was working on my machine and on hosting server that provides MySQL version higher than 4.1.1. As also mentioned in MySQL reference manual, those function are only introduce after 4.1.1
Go to the top of the page
 
+Quote Post
TavoxPeru
post Nov 22 2006, 08:21 PM
Post #6


Super Member
Group Icon

Group: [HOSTED]
Posts: 805
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579
myCENTs:46.87



QUOTE(faulty.lee @ Nov 21 2006, 11:48 PM) *

Those are MySQL's functions. I wrote the web software myself. It was working on my machine and on hosting server that provides MySQL version higher than 4.1.1. As also mentioned in MySQL reference manual, those function are only introduce after 4.1.1

Well, a few months ago i need the same functions exactly for the same reasons as you and lucky me i found this php code but i dont remember where i found it sad.gif so i hope it helps you.

CODE
<?php
function datediff($interval, $datefrom, $dateto, $using_timestamps = false) {
    /*
    $interval can be:
    yyyy - Number of full years
    q - Number of full quarters
    m - Number of full months
    y - Difference between day numbers
    (eg 1st Jan 2004 is "1", the first day. 2nd Feb 2003 is "33". The datediff is "-32".)
    d - Number of full days
    w - Number of full weekdays
    ww - Number of full weeks
    h - Number of full hours
    n - Number of full minutes
    s - Number of full seconds (default)
    */

    if (!$using_timestamps) {
        $datefrom = strtotime($datefrom, 0);
        $dateto = strtotime($dateto, 0);
    }

    $difference = $dateto - $datefrom; // Difference in seconds

    switch($interval) {
        case 'yyyy': // Number of full years
            $years_difference = floor($difference / 31536000);
            if (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom), date("j", $datefrom), date("Y", $datefrom)+$years_difference) > $dateto) {
                $years_difference--;
            }
            if (mktime(date("H", $dateto), date("i", $dateto), date("s", $dateto), date("n", $dateto), date("j", $dateto), date("Y", $dateto)-($years_difference+1)) > $datefrom) {
                $years_difference++;
            }
            $datediff = $years_difference;
            break;

        case "q": // Number of full quarters
            $quarters_difference = floor($difference / 8035200);
            while (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom)+($quarters_difference*3), date("j", $dateto), date("Y", $datefrom)) < $dateto) {
                $months_difference++;
            }
            $quarters_difference--;
            $datediff = $quarters_difference;
            break;

        case "m": // Number of full months
            $months_difference = floor($difference / 2678400);
            while (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom)+($months_difference), date("j", $dateto), date("Y", $datefrom)) < $dateto) {
                $months_difference++;
            }
            $months_difference--;
            $datediff = $months_difference;
            break;

        case 'y': // Difference between day numbers
            $datediff = date("z", $dateto) - date("z", $datefrom);
            break;

        case "d": // Number of full days
            $datediff = floor($difference / 86400);
            break;

        case "w": // Number of full weekdays
            $days_difference = floor($difference / 86400);
            $weeks_difference = floor($days_difference / 7); // Complete weeks
            $first_day = date("w", $datefrom);
            $days_remainder = floor($days_difference % 7);
            $odd_days = $first_day + $days_remainder; // Do we have a Saturday or Sunday in the remainder?
            if ($odd_days > 7) { // Sunday
                $days_remainder--;
            }
            if ($odd_days > 6) { // Saturday
                $days_remainder--;
            }
            $datediff = ($weeks_difference * 5) + $days_remainder;
            break;

        case "ww": // Number of full weeks
            $datediff = floor($difference / 604800);
            break;

        case "h": // Number of full hours
            $datediff = floor($difference / 3600);
            break;

        case "n": // Number of full minutes
            $datediff = floor($difference / 60);
            break;

        default: // Number of full seconds (default)
            $datediff = $difference;
            break;
    }
    return $datediff;
}
//echo datediff('d','9/7/2006','12/7/2006')
//this will return the interval of day between the 2 days
?>

Best regards,
Go to the top of the page
 
+Quote Post
faulty.lee
post Nov 23 2006, 05:02 AM
Post #7


Super Member
Group Icon

Group: [HOSTED]
Posts: 500
Joined: 5-November 06
Member No.: 17,016
myCENTs:NEGATIVE[-20.12]



Thanks, that sure helps.

Actually I was also looking for a way to do it in mysql itself, cause my query involve some recursive calculation on date/time. If it were to read the result then process by php, performance will be greatly reduce. Well, if there's no alternative, then that might have to be the only way out.

Thanks again
Go to the top of the page
 
+Quote Post
NoMore
post Nov 24 2006, 05:25 AM
Post #8


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 53
Joined: 11-November 06
Member No.: 17,170



according to my script
MySQL Version:4.0.26-Max
MySQL client Version:4.1.21
my script chackes server details (homepage -> Server Details) based on MySQL conection to a user

NoMore
Go to the top of the page
 
+Quote Post
CaptainRon
post Nov 24 2006, 03:14 PM
Post #9


Premium Member
Group Icon

Group: Members
Posts: 238
Joined: 9-September 05
Member No.: 8,400



Why don't we put up a request to the admin that to upgrade to MySQL 5?
Is there any way by which backward compatibility be maintained?
Go to the top of the page
 
+Quote Post
TavoxPeru
post Nov 25 2006, 06:20 AM
Post #10


Super Member
Group Icon

Group: [HOSTED]
Posts: 805
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579
myCENTs:46.87



QUOTE(faulty.lee @ Nov 23 2006, 12:02 AM) *

Thanks, that sure helps.

Actually I was also looking for a way to do it in mysql itself, cause my query involve some recursive calculation on date/time. If it were to read the result then process by php, performance will be greatly reduce. Well, if there's no alternative, then that might have to be the only way out.

Thanks again

You are welcome, and if you want a way to do it in mysql well you can check the store procedures and functions -it works since version 5.0- or you can create your own functions using the UDF interface or also you can add functions as native (built in) mysql functions, this what i found at the mysql manual:
QUOTE
  • You can add functions through the user-defined function (UDF) interface. User-defined functions are compiled as object files and then added to and removed from the server dynamically using the CREATE FUNCTION and DROP FUNCTION statements. See Section 24.2.2, “CREATE FUNCTION Syntax”.
  • You can add functions as native (built-in) MySQL functions. Native functions are compiled into the mysqld server and become available on a permanent basis

Best regards,
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Closed TopicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. MySQL Realtime Replication(4)
  2. Recover Tables From A MySQL .frm File(8)
  3. New Nvidia Display Driver Was Released On 1/6(2)
  4. What Version Of Macos Do You Use?(12)
  5. [PHP + MySQL] Encrypting Data(11)
  6. MySQL For EasyPHP Users(5)
  7. MySQL Output Database Question(18)
  8. Important: Basics Of Using PHP And MySQL(10)
  9. The Best Version Of Windows(42)
  10. CuteNews: PHP-based Blog System - No MySQL(11)
  11. MySQL, Multiple Tables(24)
  12. PHP & MySQL: Displaying Content From A Given ID(6)
  13. Navcat For MySQL(9)
  14. Qupis : Free Cpanel Web Hosting (one Line Text Ad At Bottom)(10)
  15. Ajax + Php + Sql = Simply Superb! ( With Visitor Tracking )(11)
  1. Php Tutorial: Making A Shoutbox(12)
  2. Login System Using A Mysql Db(5)
  3. Mysql Database Entry By Excel Sheets(2)
  4. How To: Display A Members/user List.(3)
  5. Any Website Provide Free Host Mysql Host?(4)
  6. What Version Of Photoshop Should I Buy?(12)
  7. Mysql Multiple Tables(1)
  8. Which Linux Version For Newbies?(14)
  9. What You Need Before You Can Create A Text-based Game..(7)
  10. Mysql Overhead(3)
  11. Which Language Is Easy And Secure Today For Web Development(2)
  12. Login System(6)
  13. Small Issues About Mysql Connector/j 5.1(2)


 



- Lo-Fi Version Time is now: 4th December 2008 - 01:53 AM