Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. Well, you can at least reduce it to two queries... $values = array(); $query = 'SELECT a, b, c FROM week ORDER BY id DESC LIMIT 1'; $result = mysql_query($query) or die(mysql_error()); $values['a']['current'] = mysql_result($result, 0, "a"); $values['b']['current'] = mysql_result($result, 0, "b"); $values['c']['current'] = mysql_result($result, 0, "c"); $query = 'SELECT SUM(a) AS a, SUM(b) AS b, SUM(c) AS c FROM week'; $result = mysql_query($query) or die(mysql_error()); $values['a']['sum'] = mysql_result($result, 0, "a"); $values['b']['sum'] = mysql_result($result, 0, "b"); $values['c']['sum'] = mysql_result($result, 0, "c"); You should then be able to use the example here: http://us2.php.net/array_multisort#id2766574 to sort your results.
  2. It means that the $rsx object has not been created. $rsx should be an instance of the class that contains the "getrows()" function.
  3. You may not want to have the "@" before your command names while you are testing...it will suppress any errors.
  4. Use file to read the site into an array...it will determine each element by the newline characters (\n or \r or \n\r). Then just echo out a part of the array... echo implode("", array_slice($remote_site, $offset, 30));
  5. I think I posted about using move_uploaded_file in one of your other threads..... $pathname = "d:/websites/www.twenterprize.com/upload/"; $uniqueDir = $_POST['mls']; mkdir($pathname . $uniqueDir); move_uploaded_file($_FILES['image']['tmp_name'], $pathname . $uniqueDir . $_FILES['image']['name']); //or as you had it: $Ndir = $pathname . $uniqueDir; $ftmp = $_FILES['image']['tmp_name']; $oname = $_FILES['image']['name']; $fname = $Ndir.$_FILES['image']['name'];
  6. That doesn't make any sense. Please clarify.
  7. Have you read php's installation instructions? They are very detailed and should help you in setting up your server.
  8. NOW() produces an integer that is equal to the number of seconds since the epoch (some where around 1970ish). You should be able to accomplish what you want simply subtracting the number of seconds in 5 minutes from NOW()... SELECT * FROM member WHERE online BETWEEN(NOW() AND (NOW() - 300))
  9. Well, you can either combine your queries into one, then place an ORDER BY clause on it, or you can do two (or however many) queries and place all your data into an array, then sort the array. What are your queries?
  10. There's no having a go at it. Just include the file that has the "archive" class in your script.
  11. Not sure what you mean...like add the latter two columns and sort by that? SELECT col_a ORDER BY (col_b + col_c) ASC I think should work...haven't tried it.
  12. You can't unlink a file that's a website...which is what it interprets the http:// to mean. You have to give it a local path. Use realpath: http://www.php.net/realpath
  13. Not sure what tutorial you're using, but I found a lot of info about using Apache 2.2 and PHP 5.2 together at www.apachelounge.com, so you may want to search around there some.
  14. have you used the gmmktime and gmdate functions? http://www.php.net/gmmktime http://www.php.net/gmdate
  15. Ummm, a database? Oracle keeps as much data as possible in RAM...there is a free version that's limited to 4GB of RAM and I think 4 TB of data...you can assign it enough RAM to keep your data there.
  16. Ok, so what's the problem? Make sure that you have error reporting turned on.... ini_set("display_errors", 1); error_reporting(E_ALL);
  17. It means that where ever you are trying to instantiate the zip_file class, you aren't including the file that contains the archive class.
  18. use the move_uploaded_file function: http://www.php.net/move_uploaded_file
  19. change: $query = mysql_query("SELECT * FROM $table WHERE 'firstname' LIKE '%$searchin%' OR 'lastname' LIKE '%$searchin%'"); to: $query = mysql_query("SELECT * FROM $table WHERE 'firstname' LIKE '%$searchin%' OR 'lastname' LIKE '%$searchin%'") or die(mysql_error()); and see what the error is. I'm putting my money on the single quotes around your table name. That is supposed to be a back-tic ( ` ) not a single quote ( ' ).
  20. use the wordwrap function. http://www.php.net/wordwrap You will be particularly interested in the fourth parameter, of which the manual says: So, you would use: echo '<td>' . wordwrap($potentially_long_word, 40, "<br />", 1) . '</td>';
  21. Instead of using fopen and fread to get the contents of a website, just use file_get_contents (http://www.php.net/file_get_contents), or file (http://www.php.net/file). Either of those will read the entire "text" (html) of the website into a variable (string in the case of the former, array for the latter).
  22. Just do a header to redirect the user to the download.... header("Location: http://www.someothersite.com/filetodownload.txt"); The user will download the file and your server won't have to do anything.
×
×
  • 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.