Jump to content

davieboy

Members
  • Posts

    46
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

davieboy's Achievements

Member

Member (2/5)

0

Reputation

  1. HI there appreciate the code, something to look at for sure. Not got anything yet, just trying to get an idea of how to do it. Is it possible to just get the last URL tweeted, say for example, someone tweets my web address, have a script that checks that twitter account (or hashtag search) and will pick the latest one tweeted,and do something with it? Dave
  2. Hi there I'm trying to find out how to extract a URL from a tweet if someone tweets me. Can't see anything obvious online. Anyone able to help or advise Thanks Dave
  3. HI All im trying to follow the o' tutorials but coming up totally blank if(!$data=simplexml_load_file("http://maps.googleapis.com/maps/api/directions/xml?origin=51.519812,-0.200774&destination=51.26246,-1.084024&sensor=false")){ trigger_error('Error reading XML file',E_USER_ERROR); } echo 'Displaying contents of XML file...<br />'; foreach($data as $directions){ echo 'Start: '.$directions->route->leg->step->start_location->lat.' <br>End: '.$directions->route->leg->step->end_location->lng.'<br> HTML: '.$directions->route->leg->step->html_instructions.' <br>Distance: '.$directions->route->leg->step->distancee->text.'<br /><br>'; } Results just wont show at all, i know its to do with the way im going through the xml fields, but cant see where Can anyone help me at all?
  4. how would it get the email address from the filled in fields? david
  5. Im trying to develop a script that will parse an email address when a user enters it on a forum signup script, it will check against other registered users. (I have this script.) The 'parsing' will need to be done via a different site. Any ideas on how i would go about this David
  6. i cant see how to get this done. when editing pages it makes no difference. could someone help me with it? david
  7. actually ive changed it a we bit. trying to find out the total number of images in the database from certain people ordered by the most number first. SELECT *, COUNT(id) AS COUNT FROM photos WHERE status ='accepted' and in_screening = '1' GROUP BY copyright DESC LIMIT 5 and its not working
  8. figured part of it out $query = "SELECT *, COUNT(hits) AS COUNT FROM photos GROUP BY copyright LIMIT 5"; //$query = "SELECT device_id, COUNT(week) AS count FROM failed WHERE week = '$week' GROUP BY device_id"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { echo $row['id'] . ' <a href=\"/photographer.php?photographer=' . $row['copyright'] .'\">' . $row['copyright'] . '</a><br>'; $copyright = $row['copyright']; $hits = $row['hits']; giving an odd number at the top thought 2460 3111 user1 2477 user2 2094 user3 2062 user4 not sure why or where from
  9. Hi all Im using the pagination successfully, but now i do have quite alot of pages being given in results eg im using the standard <?php include("config.php"); mysql_connect($db_host,$db_user,$db_pass); mysql_select_db ($db_name) or die (mysql_error()); $limit = 15; $query_count = "SELECT * FROM photos WHERE status = 'accepted'"; $result_count = mysql_query($query_count); $totalrows = mysql_num_rows($result_count); $PHP_SELF = $_SERVER['PHP_SELF']; if(!isset($_GET['page'])){ // Checks if the $page variable is empty (not set) $page = 1; // If it is empty, we're on page 1 } else{ $page = $_GET['page']; } $limitvalue = $page * $limit - ($limit); // Ex: (page2 * 5(items per page) = 10) - 5 = 5 <- data starts at 5 and after my content if($page != 1){ $pageprev = $page - 1; //decrementing $page-- does not work on all php configurations. echo("<a href=\"$PHP_SELF?page=$pageprev\"><b>PREV</b>".$limit."</a> "); }else{ echo("PREV".$limit." "); } $numofpages = $totalrows / $limit; #echo "<br>", $totalrows; #exit; for($i = 1; $i <= $numofpages; $i++){ /* This for loop will add 1 to $i at the end of each pass until $i is greater than $numofpages. */ if($i == $page){ echo($i." "); }else{ echo("<a href=\"$PHP_SELF?page=$i\">$i</a> "); } } //code above has been decoded lozza if(($totalrows % $limit) != 0){ if($i == $page){ echo($i." "); }else{ echo("<a href=\"$PHP_SELF?page=$i\">$i</a> "); } } if(($totalrows - ($limit * $page)) > 0){ $pagenext = $page + 1; //incrementin $page like $page++ does not work in all enviroments echo("<a href=\"$PHP_SELF?page=$pagenext\"><b>NEXT</b>".$limit."</a>"); }else{ echo("NEXT".$limit); } mysql_free_result($result); ?> Just wondering how i can limit the results to say 10->15 pages and have the next and previous links on the end eg instead of the above have Thanks to all David
  10. how would i then get it with the totals $query = "SELECT *, SUM(hits) FROM photos GROUP by hits DESC LIMIT 5"; $result = mysql_query($query) or die(mysql_error()); // Print out result while ($r=mysql_fetch_array($result)) { $id=$r["id"]; $copyright =$r["copyright"]; $hits= $r["hits"]; $airline = $r["airline"]; echo "<a href=\"photographer.php?photographer=$copyright\">$hits / $copyright<br>"; // }
  11. cant find a way to get wither codes posted to work David
  12. I have a database of images each which gets it own number of hits. how do i then 'add ' all these hits together to get a total number of hits? SELECT *, COUNT(hits) FROM photos GROUP BY hits DESC LIMIT 5 is my attempt but i know its wrong david
  13. its still not working http://fsimages.net/tests/tophits.php its grouping everything with the first number of the hits ie 5 and 55 are in the same line etc...(see above link)
  14. no still not working http://www.fsimages.net/tests/tophits.php i have hits in the DB with 141 and its only showing ones with 9 all code // Make a MySQL Connection include("config.php"); mysql_connect($db_host,$db_user,$db_pass); mysql_select_db ($db_name) or die (mysql_error()); $query = "SELECT * FROM `photos` WHERE `STATUS` = 'accepted' ORDER BY `hits` DESC LIMIT 5"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo "There are ". $row['hits'] ." ". $row['id'] .""; echo "<br />"; }
  15. im using this code SELECT * FROM photos WHERE STATUS = 'accepted' ORDER BY hits DESC LIMIT 5 but it only shows 5 from the DB and not the ones with the most hits ver confused David
×
×
  • 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.