User Profile

Collapse

Profile Sidebar

Collapse
Karl Engstrom
Karl Engstrom
Last Activity: Mar 6 '07, 02:08 AM
Joined: Jan 18 '07
Location: OC
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thanks Ronald, you nailed it!

    Not more than an hour ago I saw the err of my ways (with help from a buddy). Our code looks just like yours with slightly different var names. Now I'm on to the next phase...

    I'm learning all the time & really enjoying PHP!

    MegaThanks for your help!
    Karl
    See more | Go to post

    Leave a comment:


  • Hi Ronald-

    my echo is just
    Code:
    echo $zcodes;
    for checking the oputput.

    Here's what I'm working with as of now:
    Code:
    {
     $z = new zipcode_class;
     $zips = $z->get_zips_in_range($_POST["zip1"], $_POST["radius"], _ZIPS_SORT_BY_DISTANCE_ASC, true);
     if ($zips === false) echo 'Error: '.$z->last_error;
     else {
         $vzips=0;
         foreach ($zips
    ...
    See more | Go to post

    Leave a comment:


  • Karl Engstrom
    replied to implode an array for query condition
    in PHP
    Can we bounce this one? I re-started it under a more descriptive title.

    Thanks,
    Karl
    See more | Go to post

    Leave a comment:


  • Karl Engstrom
    started a topic How to use associative array in WHERE clause
    in PHP

    How to use associative array in WHERE clause

    (I started this under an improper title, will request bounce of the other)
    Hello All-
    I'm new to php. I'm working on using a zip code class I found in order to create a locater app using 2 tables in a db, one is US zip codes with lat & log info and the other table is company info with a zip code field.
    The output I'm working with is an associative array with zip codes and the distance from the originating zip code they are....
    See more | Go to post

  • Karl Engstrom
    replied to implode an array for query condition
    in PHP
    I'm gonna try that... After iterating through the first array with
    Code:
    foreach ($zips as $key => value)
    I need to split a string that looks like
    926299262492693 926779267592673 926079267492672
    into one that looks like
    92629,92624,926 93,92677,92675, 92673,92607,926 74,92672
    so it can be used in a WHERE clause.

    I've been reading & trying diffrent things, no success yet.
    Any suggestio...
    See more | Go to post

    Leave a comment:


  • Karl Engstrom
    replied to implode an array for query condition
    in PHP
    Can I make the string ($key) an array to use in a query, maybe?

    Karl
    See more | Go to post

    Leave a comment:


  • Karl Engstrom
    replied to implode an array for query condition
    in PHP
    Kinda new/part-time with php, learning every time I sit down with it, please excuse my ignorance.
    OK, I guess I'm on the wrong path. I'll detail things a little...
    I'm using a class for querying a single table zip code db. I'm adding a table of companies and making a company locator based on range from originating zip code.
    I have
    Code:
    $z = new zipcode_class;
    $zips = $z->get_zips_in_range($_POST["zip1"],
    ...
    See more | Go to post

    Leave a comment:


  • Karl Engstrom
    started a topic implode an array for query condition
    in PHP

    implode an array for query condition

    Hi All,

    I'm newish to php & have an issue on a project I'm working on...

    I've an array containing zip codes which displays if I echo it like
    Code:
    echo "$key";
    it returns 926299262492693 926779267592673 926079267492672

    I need to implode/explode with commas so it passes like 92629,92624,926 93,92677,92675, 92673,92607,926 74,92672 so I can use it as a WHERE IN condition.

    ...
    See more | Go to post
No activity results to display
Show More
Working...