Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. Don't click the back button... It's a browser thing, there's nothing you can do server side to prevent it that I know of off hand. The only thing that might work, and I've never tried it, so I don't know, is to set the expire header to some date in the future, rather than the past...however if the user visits the page in the future, but before the expire, and you want them to have updated data, the browser may not display it...it may pull from the cache.
  2. How do you determine xp per person and per team?
  3. FF stores them in one place, the "favorites.html" file...I don't think IE does, it stores shortcuts in a particular folder in the user's profile for favorites.
  4. set @rank = 0; SELECT team, @rank := @rank + 1 AS rank FROM teams ORDER BY xp DESC;
  5. The user can not submit a file to a webpage via ftp...it will always be sent from the user's browser to the web server using http (at least from an html form...of course IE and FF can act as FTP agents, but then the user wouldn't be submitting a file from a form). Once it's been uploaded to the server by the user (via http) the server can ftp it somewhere else if you choose.
  6. you have a rogue single quote here: sc, pd.products_name' limit 0, 8 Remove it from your query.
  7. I think this: $middlerank=(($winner[rank] + $loser[rank]) - 0.5); $new_winner_rank=round(($middlerank / 2) - 0.5); Should be using multiplicity rather than subtraction... $middlerank=(($winner[rank] + $loser[rank]) * 0.5); $new_winner_rank=round(($middlerank / 2) * 0.5); Also, I hope you are intentionally halfing again the "new winner rank" from the middle rank...making the new rank a quarter of the original value.
  8. dbillings... The reason you don't do that is because doing so doesn't actually reduce the size of the image. This means if the image of your daughter is 10 MB in size and you decide that the whole world needs to see that image on the front page of your website, then every visitor must download all 10 MB and then the browser reduces the size client side, even if they don't want to see the full size image. If you create a thumbnail, say 100px X 100px, then that formly 10 MB pic is now probably 5k...the users who want to see the full size image can click it and see the large version, everyone else doesn't have to waste their time downloading something they don't need to. Additionally, the browser usually does a crappy job of "reducing" the size.
  9. It's not exactly easy...or common place. You will probably want to look at one of the GIS packages available...there are some open source ones listed here: http://opensourcegis.org/
  10. SELECT cat_title, count(*) FROM Vendors v LEFT JOIN Category c1 ON v.cat_id = c1.cat_id LEFT JOIN Category c2 ON v.cat_id2 = c2.cat_id LEFT JOIN Category c3 ON v.cat_id3 = c3.cat_id LEFT JOIN Category c4 ON v.cat_id4 = c4.cat_id LEFT JOIN Category c5 ON v.cat_id5 = c5.cat_id GROUP BY cat_title ORDER BY cat_title; I think it'll work...of course I haven't tried it : )
  11. Use php to randomly select the table, then use mysql to randomly select a row...I'm assuming that's what you want... $tables = array('table1', 'table2'); $which = array_rand($tables); $result = mysql_query("SELECT fieldname FROM " . $tables[$which] . " ORDER BY RAND() LIMIIT 1") or die(mysql_error()); echo 'Result from table ' . $tables[$which] . ' was: ' . mysql_result($result, 0);
  12. An api is simply a set of calls that you put in place in your application to allow others to use it. For example, the digg api allows external users to view diggs as they happen, among other things, via a set of functions that interact with their system.
  13. for ($i = 0; $i < count($array); $i + 2) { echo $array[$i] . '<br />' . $array[$i + 1]; } Probably want to put in a check to see if $array[$i + 1] exists...there is a potential for it not to.
  14. http://en.wikipedia.org/wiki/Api
  15. What user controls do you have on your database? If you have permissions all the way down to the column level, or even the table level, for any user, it forces mysql to check those permissions for all users. That can significantly slow down user authentication. Additionally, depending on how you are specifying your connection, it can affect your connection speed. For example, the default connection method for Windows will be TCP/IP, even if you specify "localhost". If you are using shared memory as the connector on windows, it will be much slower than TCP/IP. If you have *nix, then [assuming default settings] the default connection, so long as you put "localhost" as the host name for the db connection, will be named pipes...which is faster than the network...even the loopback interface.
  16. I did have that backwords...oops, stupid brain...I meant that only InnoDB supports transactions...sorry for any confusion.
  17. Need to put a WHERE in the query... change: if (count($query_parts) > 0) { $query .= implode(" OR ", $query_parts); } to if (count($query_parts) > 0) { $query .= " WHERE " . implode(" OR ", $query_parts); }
  18. What version of php are you using? That will only work in php >= 5.1 This post may help... http://us3.php.net/manual/en/function.date-default-timezone-set.php#75648
  19. What is the character set for the database? I think arabic is a mulibyte character set, so if the database isn't prepared for it, it will mess up the encoding. http://dev.mysql.com/doc/refman/5.0/en/charset.html
  20. What do you mean "whole content of a webpage"? You can get the html of a page using the file functions...for example: $html = file_get_contents("http://www.phpfreaks.com");
  21. I gave you the wrong function...I think this one would be better: date_default_timezone_set('Europe/Dublin'); http://www.php.net/date_default_timezone_set()
  22. So long as it's the same version of MySQL, and you copy ALL of the files, it may work. I've never tried, as whenever I have a need to do something like that, I take the opportunity to upgrade MySQL to the newest version and use mysqldump to export the data, then import it with mysqladmin.
  23. Use the setlocale function http://www.php.net/setlocale
×
×
  • 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.