1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Looking for help on smarty

Discussion in 'PHP' started by kmap, Nov 29, 2007.

  1. #1
    hi

    I want to searcg for zip for latitude and longitude and store that in user table


    $m11 = myF(myQ("SELECT latitude,longitude FROM `[x]zipcode` WHERE `zip_code`=501"));
    $lat=m11["latitude"];
    $lat2=m11["longitude"];



    function myQ($content) {
    global $CONF;

    if (!isset($GLOBALS["MYSQL_CONNECTION"]) or !$GLOBALS["MYSQL_CONNECTION"]) myConnect();
    return mysql_query(str_replace("[x]", $CONF["MYSQL_DATABASE_TABLES_PREFIX"], $content));
    }

    Can anybody tell me where i am wrong
     
    kmap, Nov 29, 2007 IP
  2. Xexi

    Xexi Well-Known Member

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    100
    #2
    You forgot to add a dollar sign ($) in front of you variables. Link to php.net explanation of variables.

    Try using these to call your array instead. :)
    $lat=$m11["latitude"];
    $lat2=$m11["longitude"];
    $lat=$m11->latitude;
    $lat2=$m11->longitude;
    Code (markup):
     
    Xexi, Dec 1, 2007 IP
    kmap likes this.
  3. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #3
    thanks buddy

    I forget it in hurry

    Regards

    Alex
     
    kmap, Dec 2, 2007 IP