Jump to content

paul2463

Members
  • Posts

    955
  • Joined

  • Last visited

    Never

Everything posted by paul2463

  1. the number you mentioned is a <i>timestamp</i> and equates to 29th November 2004 if you want to know all entries in the last 7 days you need the <i>timestamp</i> for 7 days ago <?php $today = strtotime("NOW"); // timestamp for today $lastweek = strtotime("-7 day", $today); //take off seven days $query = "SELECT * WHERE File_time > '$lastweek'"; ?>
  2. if this problem as answered anything it is this <i><b> always always always use 'or die "Error in query" . mysql_error());' in your query statements</b></i> it tells you the answers to so many easy problems, and will not throw errors if your code is good - so no overheads
  3. WHERE <b><i> WHAT</i></b> = team1???
  4. try getting mysql to answer the problem for you.....it has tried by telling you that "Topic: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource" in other words the query has FAILED try $result = mysql_query("SELECT * FROM users WHERE username='admin'") or die ("Error in query" . mysql_error()); and see what it says is wrong
  5. I have no idea why it would do that I am afraid as I cant see the code on the page where it is directed to go, there is some working out done there and I made assumptions about the hidden fields passing the correct data across, but I cant work out what happens when actually downloading files
  6. yes sorry how stupid of me, they should look like the rest of it, sorry print("<input type=\"hidden\" name=\"dlzip\" value=\"Download As Zip File\" />"); and print("<input type=\"hidden\", name=\"dlnzb\" value=\"Download As NZB\" />");
  7. yeah sorry remove the commas after the type="hidden" thats one thing and an other is that at the top of the page (lines 98 and 99) there are other button calls for this problem you have you may need to change them too to the following if (getNzbPermissions("part") == 1 && $CURUSER["nzbstodaydl"] < getNzbPermissions("maxdlpday")) { $pl .= "<br /><div align=\"center\"><input type=\"image\" name=\"dlzip\" src=\"/image/zip.gif\" style=\"width:200px;height:25px;\" alt=\"ZIP\"/><input type="hidden", name="dlzip" value="Download As Zip File" />". " <input type=\"image\" name=\"dlnzb\" src=\"/images/nzb.gif\" style=\"width:200px;height:25px;\" alt=\"NZB\"/><input type="hidden", name="dlnzb" value="Download As NZB" /></div><br /><br />\n"; but becasue all you have done is put in he hidden fields then the comma may sort it out for you
  8. just make it like this echo " - <a href=\"show_records.php?id={$row['id']}\">{$row['name']} ({$row['count']})</a></br>";
  9. I think I know what the problem is, when you change it to an image instead of sending the name it sends the names location here is what I mean, please ignore the test data involved for the minute with button with image notice that the dlzip part has now been split into an x and a y value, if your checking page needs the posted value of "DLZIP" or "DLNZB" then you will have to do the following under each instance of the changed image you have done put either one of the two folloing line which is appropriate print("<input type="hidden", name="dlzip" value="Download As Zip File" />"); print("<input type="hidden", name="dlnzb" value="Download As NZB" />"); so your code above would read if (getNzbPermissions("zip") == 1) print("<input type=\"image\" name=\"dlzip\" src=\"/image/zip.gif\" style=\"width:200px;height:25px;\" alt=\"ZIP\"/>"); print("<input type="hidden", name="dlzip" value="Download As Zip File" />"); if (getNzbPermissions("nzb") == 1) print(" <input type=\"image\" name=\"dlnzb\" src=\"/images/nzb.gif\" style=\"width:200px;height:25px;\" alt=\"NZB\"/>"); print("<input type="hidden", name="dlnzb" value="Download As NZB" />"); these will send the right value across with the image such as now it prints out i hope all that makes sense
  10. one thing you could try, you could make it a LEFT JOIN, which will return all members of the first table even though they do not have anything in the second table, it may be worth a try to see if you get the link_types out
  11. you don't need a second query for each category, that query is a good one and works, it found all the construction things for you, it seems a bit noddy but you are going to have to go into the database and make sure you have put the correct type_id in the links table because it should work
  12. that then is a problem with the form coding as long as the clicking the image takes you somewhere then that bit works, you now have to look at the "FORM ACTION=\"somewhere.php\" and see where it is supposed to send you, when you have loaded the page have a look at the page source and see where it is going to send you and see if that is where you want to go.
  13. not a clue myself, I should have the best teeth in the world as I had over 80 bogus dental visits during my last year at school at 16 ( IMO the dentist should not have given me an appointment card which could fit 12 appointments on it) but for not attending school I now teach people how to fly and fight with an apache helicopter as a simulator instructor for the British military, and code in my spare time, so to answer the question ,my highest maths was very basic indeed
  14. $query = "SELECT `id` FROM `schools` WHERE `name` LIKE '$name'";
  15. I have just checked your code on my local server using firefox and IE7 and both do what you want them to do
  16. remove the $connection statement from you query call <?php // Connects to your Database mysql_connect("localhost", "username", "pw") or die(mysql_error()) ; mysql_select_db("bruceg_PublishingSystem") or die(mysql_error()) ; $query = "SELECT link_types.id, link_types.name, COUNT(links.name) as `count` FROM link_types JOIN links ON link_types.id = links.type_id GROUP BY link_types.name "; $result = mysql_query($query) or die (mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<a href=\"show_records.php?id={$row['id']}\">{$row['name']} ({$row['count']})</a>"; } ?>
  17. unfortunately if you want someone to write your code for you then you need to be in freelancing and pay for it, here we help each other to learn by pointing out the mistakes and going away and correcting them, you did not follow my instructions fully all you did was to change the word "submit" for the word "image" now go back and remove all the "value" coding and replace it with "src" coding as I did in the first post I replied to you, if you then add an "alt" coding to it , if it cant find the image that's the word it will put there, again as I did in the first post I made on this. I am not trying to make excuses so I don't have to write it for you - I don't - but I have pointed out what you need to do and you will learn more by doing it for yourself
  18. if you are getting a mysql_error then the reason is that "COUNT" is a mysql reserved word so your query syntax should be $query = "SELECT link_types.id, link_types.name, COUNT(links.name) as `count` FROM link_types JOIN links ON link_types.id = links.type_id GROUP BY link_types.name "; and also where does $connection come into it, you have already connected to the database in the lines before it
  19. what you need to do is to find all references to which mention the download parts and replace it with then also remove the value part and replace with src=\"image location\" for ech button hope that helps
  20. change this line $pl .= "<br /><div align=\"center\"><input type=\"submit\" name=\"dlzip\" value=\"Download Selected in Zip File\" class=\"codebuttons\" style=\"width:200px;height:25px;\" />". " <input type=\"submit\" name=\"dlnzb\" value=\"Download Selected as NZB\" class=\"codebuttons\" style=\"width:200px;height:25px;\" /></div><br /><br />\n"; to this $pl .= "<br /><div align=\"center\"><input type=\"image\" name=\"dlzip\" src=\"image location\" style=\"width:200px;height:25px;\" alt=\"ZIP\"/>". " <input type=\"image\" name=\"dlnzb\" src=\"image location\" style=\"width:200px;height:25px;\" alt=\"NZB\"/></div><br /><br />\n"; not forgetting to place the image locations in where it says "image location"
  21. I h ave made some changes to your code, I have broken it down a bit more to help me go through it and I have put some echo statements is to show whats happening <?php $holidayList = array("04-03-2008","07-03-2008"); $j = $i = 0; //changed this to 0 or you were always starting one day ahead $given_date = "3/1/2008"; $tmp1 = strtotime($given_date); //worked out a timstamp to start with while($i < 14) { $tmp2 = strtotime("+$j day", $tmp1); $day = strftime("%A",$tmp2); echo strftime("%d-%m-%Y",$tmp2); echo " $day"; $tmp = strftime("%d-%m-%Y",$tmp2); if(($day != "Sunday") && ($day != "Saturday" )&&(!in_array($tmp, $holidayList))) { $i = $i + 1; $j = $j + 1; echo "<BR>"; } else { $j = $j + 1; echo " - weekend! or Holiday! <BR>"; } } $j = $j -1; $newdate = strtotime("+$j day",$tmp1); echo strftime("%A, %d-%m-%Y",$newdate); ?> and it printed out the following which I believe is correct for your number of days and holiday list
  22. have just tested it on my system todays date Wednesday, 02-04-2008 function run with 5 days reads out Wednesday, 09-04-2008 amended to read 10 working days (two weeks) it reads Wednesday, 16-04-2008 changed to 14 ( your problem days) it reads Tuesday, 22-04-2008 which is correct if you discount weekends as the function does
  23. here is your problem, the clue is in the error....... updateevent.... $updateevent="UPDATE events SET solved = 'Y' WHERE solID = '$solID'"; $result=mysql_query($updateevent) or die(mysql_error()); //you missed off the dollar sign to the query statement call
×
×
  • 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.