harristweed
Members-
Posts
346 -
Joined
-
Last visited
-
Days Won
1
Everything posted by harristweed
-
Just can't figure out why implode doesn't work as expected.
harristweed replied to drayarms's topic in PHP Coding Help
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; -
both free http://ckeditor.com/ http://www.tinymce.com/
-
<a href="<?php echo "{$rsjobs['CompanyURL']}\"> {$rsjobs['CompanyURL']}";?></a>
-
Looping problem (dropping a record every 6th row)
harristweed replied to shamwowy's topic in PHP Coding Help
<?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(); ?> -
Help displaying Now & Next events form sql database
harristweed replied to hotmert's topic in PHP Coding Help
As you are only using one table, you don't need UNION! -
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!
-
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"; $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"; ?>
-
Help displaying Now & Next events form sql database
harristweed replied to hotmert's topic in PHP Coding Help
I'd try $sql = "(SELECT date, time, event, bands FROM listings WHERE date >= CURDATE() LIMIT 0, 2 )" -
http://jqueryui.com/demos/datepicker/
-
From PHP Manual:
-
java script is best for count down timers (imho) http://www.littlewebthings.com/2010/02/jquery-countdown-script/
-
Your missing a closing brace <?php } } ?> should be <?php } } } ?>
-
SELECT ONLY THE LATEST ITEM FROM MYSQL DATABASE
harristweed replied to kamal213's topic in PHP Coding Help
http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html -
What version of PHP is your host running?
-
http://www.tizag.com/mysqlTutorial/
-
<b>Link: </b> <?php Echo '<a href="$site">$site</a>' ?> </center></br>
-
store total number of mysql_num_rows into array?
harristweed replied to atfOnly's topic in PHP Coding Help
I'm not sure but I think the problem is the isset! Try changing to : if(!empty($period[$i])|| !empty($gpa[$i]) || !empty($antecedent[$i])){ -
NEED HELP WITH PLAYER EMBEDDING AND VIDEO UPLOADING
harristweed replied to salman233's topic in PHP Coding Help
Why not load them on to Youtube and put the embed link into your page. Your host company might complain about bandwidth usage if you get many views for a video that is streaming from your site hosting. -
frost110's answer is much better than mine!
-
i assume that mysql_query($query)){ is outside your for loop therefore as you are aware only Cheetah Charly 3 are getting added try
-
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/>";
-
you are missing a " $display_block .=<p><strong><em>You are viewing:</em><br/> should be $display_block .="<p><strong><em>You are viewing:</em><br/>