SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2007
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create Function in MySQL 4.1.12

    I am trying to run the following SQL on MySQL version 4.1.12 on my live machine.

    CREATE FUNCTION distance(lat1 float, long1 float, lat2 float, long2 float) RETURNS float(11)
    RETURN (3958.75 * acos(sin(lat1/57.2958) * sin(lat2/57.2958) + cos(lat1/57.2958) * cos(lat2/57.2958) * cos(long2/57.2958 - long1/57.2958)))

    Would this not be supported with 4.1.12?

    I am running this fine on my local version of Zend Core.

    Any ideas?

  2. #2
    SitePoint Guru
    Join Date
    Jan 2004
    Location
    Uppsala, sverige
    Posts
    698
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    You need version 5.0 or later.

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2007
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I suspected as much. My host is reluctant to upgrade. They are also using PHP 4.1.2

    I have also developed some of my code using SimpleXML which is only bundled with PHP 5 so I'm struggling on 2 fronts.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •