Jump to content

harristweed

Members
  • Posts

    346
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by harristweed

  1. while ($row2 = mysql_fetch_assoc($result2)) { 
    
    //Define array to hold zips found within range.
    
    $range = array();  
    
    if((rad2deg(acos(sin(deg2rad($my_lat))*sin(deg2rad($row2['lat'])) +cos (deg2rad($my_lat)) * cos (deg2rad($row2['lat'])) * cos(deg2rad($my_lon - $row2['lon']))   ) ) )*69.09 <= $distance )
    
     { $range[] = $row2['zip']; } 
    
    //Implode the range arrary.
    
    $range = implode(',' , $range);   echo $range;
    
    
    }//End of while loop.

     

    The array is redifined every time the loop loops! so will at best only contain one zip code....

     

    //Define array to hold zips found within range.
    
    $range = array();  
    
    while ($row2 = mysql_fetch_assoc($result2)) { 
    
    
    
    if((rad2deg(acos(sin(deg2rad($my_lat))*sin(deg2rad($row2['lat'])) +cos (deg2rad($my_lat)) * cos (deg2rad($row2['lat'])) * cos(deg2rad($my_lon - $row2['lon']))   ) ) )*69.09 <= $distance )
    
     { $range[] = $row2['zip']; } 
    
    
    
    
    }//End of while loop.
    
    //Implode the range arrary.
    
    $range = implode(',' , $range);   echo $range;
    

  2. <?php
    $query1 ="    SELECT *
            FROM jitem JOIN jloc
            ON jloc.jloc_id IN(jitem.jitem_location)
            WHERE jitem.jitem_display = 1
            ORDER BY jitem_listorder";
    
            if( $r = mysql_query($query1) )
            {
            $ii = 1;
                while( $row = mysql_fetch_assoc($r) )
                {
                    if ($ii <= 5)
                    {
                        print "<td width=20% valign=top align=center>";
                        print "<a href='slides/{$row['jitem_slide']}' title='{$row['jitem_title']}' border=0 onclick=\"window.open(this.href, '','height=545,width=500');return false;\">";
                        print "<img border=0 src='thumbs/{$row['jitem_thumb']}' alt='{$row['jitem_title']}'/><br/>";
                        print "<font size=2 color=white><strong>{$row['jitem_title']}</strong></a><br/>{$row['jitem_desc']}<br/>";
                        print "\${$row['jitem_price']}</font>";
                        print "<br/><font size=2><a href=cart.php?itemid=".$row['jitem_id']."&action=add>Add To Cart</a></font>";
                        print "</td>";
                        $ii ++;
                        if($ii==5){
                            print "</tr><tr><td colspan=5> </td></tr><tr>";
                            $ii = 1;
                                }
                    }
    
                    
                }
                }
            else
            {
                print "Database returned no records. query1 is ".$query1."";
            }
    
            mysql_close();
    ?>

  3. hmmmm...I would suggest trying to insert a description outside of any functions. Just a simple..

    <?php
                $update = "UPDATE Item  SET description ='abcxyz' WHEREid = '$id' ";
                mysql_query($update, $link_id);
    ?>

     

    If that works it's your function, if not there is something else wrong!

     

     

  4. Yes but

    <?php
    $filename="image.jpg";
    $split=explode(".",$filenames");
    $name=$split[0];
    $extension=$split[1];
    ?>

     

    does not include the dot as request!

     

    <?php

    $filename="image.jpg";

    $split=explode(".",$filename);

    $name=$split[0];

    $extension=".".$split[1];

    ?>

  5. <?php
      $filename = "image.jpg";
      $dot=strpos($filename,".");
      $first_part=substr($filename,0,$dot);
      $second_part=substr($filename,$dot);
      echo "first part =$first_part<br />\n";
      echo "second part =$second_part"; 
    ?>

  6. i assume that

    mysql_query($query)){

    is outside your for loop therefore as you are aware only Cheetah Charly 3 are getting added try

    for ($j = 0; $j < 3; ++$j)

    {

    $query = "INSERT INTO cats VALUES(NULL, '$family[$j]', '$name[$j]', $age[$j])";

    if(mysql_query($query));

        };

  7. Missing $ on item_color

     

    while ($colors = mysqli_fetch_array($get_colors_res)) {
    		item_color = $colors['item_color'];
    		$display_block .=$item_color."<br/>";

     

    should be:

     

    while ($colors = mysqli_fetch_array($get_colors_res)) {

    $item_color = $colors['item_color'];

    $display_block .=$item_color."<br/>";

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.