-
Posts
1,807 -
Joined
-
Last visited
Everything posted by hitman6003
-
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.
-
I'm confused by this, Call to a member function getrows() Error
hitman6003 replied to DOK's topic in PHP Coding Help
It means that the $rsx object has not been created. $rsx should be an instance of the class that contains the "getrows()" function. -
That doesn't make any sense.
-
You may not want to have the "@" before your command names while you are testing...it will suppress any errors.
-
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));
-
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'];
-
chmod 777 foldername
-
That doesn't make any sense. Please clarify.
-
Have you read php's installation instructions? They are very detailed and should help you in setting up your server.
-
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))
-
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?
-
There's no having a go at it. Just include the file that has the "archive" class in your script.
-
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.
-
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
-
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.
-
[SOLVED] Setting time and date in GMT...
hitman6003 replied to trecool999's topic in PHP Coding Help
have you used the gmmktime and gmdate functions? http://www.php.net/gmmktime http://www.php.net/gmdate -
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.
-
Ok, so what's the problem? Make sure that you have error reporting turned on.... ini_set("display_errors", 1); error_reporting(E_ALL);
-
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.
-
Making a directory and putting a photo in it
hitman6003 replied to etourslive's topic in PHP Coding Help
use the move_uploaded_file function: http://www.php.net/move_uploaded_file -
[SOLVED] gah, php search returning 0 results!
hitman6003 replied to wickedawsome's topic in PHP Coding Help
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 ( ' ). -
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>';
-
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).
-
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.