Jump to content

socalnate

Members
  • Posts

    48
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

socalnate's Achievements

Member

Member (2/5)

0

Reputation

  1. The format is correct but it echos "4-2-2008" when todays date is "2-10-2008". Help very much appreciated...stumped. I updated my server time and rebooted my apache server but to no avail... Today's Date: <?php //----------------------------- $now = time(); $num = date("w"); if ($num == 0) { $sub = 6; } else { $sub = ($num-1); } $WeekMon = mktime(0, 0, 0, date("m", $now) , date("d", $now)-$sub, date("Y", $now)); //monday week begin calculation $todayh = getdate($WeekMon); //monday week begin reconvert $d = $todayh[mday]; $m = $todayh[mon]; $y = $todayh[year]; echo "$d-$m-$y"; //getdate converted day ?>
  2. I've been attempting to understand classes and objects. There is one bit of information I'm confused on and that is when you can use $this. From what I've read I'm assuming you can ONLY use $this to reference variables within the CLASS (brackets) only. You cannot create an object and then try to call (or echo) a variable within that class using $this. EX: <?php $myobject = new foo_object(); echo $this->foo ; ?> Correct way is this: <?php $myobject = new foo_object(); echo $myobject->foo ?> I am right? ???
  3. Can anyone please tell me how to create a log file for Apache using linux for the Google Adsense program? I'm supposed to have a log file but I can't find the access.log file (even though there should be one by default). I run a dynamic website so I want my links to be generated from a log file. Nathan ???
  4. Yeah I don't understand why I have to include FROM eg_gameplay_history in my query. I guess it has something to do with the COUNT?
  5. Thanks, This query worked! The only issue I'm having is that it is very slow...3.0645 seconds! :'( Any suggestions? SELECT eg_titles. * , eg_genres.id, eg_gameplay_history.title_id, eg_gameplay_history.played, eg_gameplay_history.play_date, COUNT( eg_gameplay_history.played ) AS 'title_count'FROM eg_titles, eg_gameplay_history LEFT JOIN eg_genres ON eg_titles.id = eg_genres.id WHERE eg_genres.genre = 'action' AND eg_titles.id = eg_gameplay_history.title_id AND eg_gameplay_history.play_date BETWEEN DATE_SUB( CURDATE( ) , INTERVAL 3 DAY ) AND CURDATE( ) GROUP BY eg_gameplay_history.title_id ORDER BY title_count DESC LIMIT 10
  6. I can't figure out why SQL is telling me why this table doesn't exist when it clearly DOES exist in my database. Any ideas? Something wrong with my SQL query? Nathan __________ Error SQL query: Documentation SELECT eg_titles. * , eg_genres.id, eg_gameplay_history.title_id, eg_gameplay_history.played, eg_gameplay_history.play_date, COUNT( eg_gameplay_history.played ) AS 'title_count' FROM eg_titles LEFT JOIN eg_genres ON eg_titles.id = eg_genres.title_id WHERE eg_genres.genre = 'action' AND eg_titles.id = eg_gameplay_history.title_id AND eg_gameplay_history.play_date BETWEEN DATE_SUB( CURDATE( ) , INTERVAL 3 DAY ) AND CURDATE( ) GROUP BY eg_gameplay_history.title_id ORDER BY title_count DESC LIMIT 10 MySQL said: Documentation #1109 - Unknown table 'eg_gameplay_history' in field list
  7. Been trying to figure out an array issue. For some reason when I echo $key it's echoing "Array". I want it to return the key (in this case adventure). Help appreciated... <?php $action_percent = 1; $adventure_percent = 20; $genre_array = array( 'action'=>$action_percent, 'adventure'=>$adventure_percent ); echo $genre_array['action']; echo $genre_array['adventure']; $max_value = max($genre_array); echo $max_value; $key = array_keys($genre_array, max($genre_array)); echo $key; ?>
  8. Can I set variables to arrays? (Problem is I'm requesting input boxes that have a different name value so I can't just $_REQUEST it to an array...I need to set the array to specific variables.) Not sure how to do it...can't find any examples. $genre_array = array( 'Genre 1' => $var1, 'Genre 2' => $var2, 'Genre 3' => $var3 );
  9. What? I turned off safe mode in my php.ini config but it says it is still turned on because it is giving me a safe mode error. Even more bizzare is that it is writing to another directory just fine when if, in theory, safe mode was actually turned on it would be restricting all files. I'm totally baffled on this one... ???
  10. Figured out the problem: Yeah when you write you can't use HTTP headers. You have to use the local file path name: EG /var/www/vhosts/yourdomain.com/httpdocs/folder/$new_file_name UGH now I'm getting a SAFE MODE error. I seriously hate SAFE MODE. lol
  11. Here's the error: Warning: move_uploaded_file(http://www.mydomain.com/titles/a5eeb0c9dea193531ddd45d2d2e0acc9_welcome.swf) [function.move-uploaded-file]: failed to open stream: HTTP wrapper does not support writeable connections. in /var/www/vhosts/mydomain.com/subdomains/dev/httpdocs/upload.php on line 541
  12. How do you move files from a sub domain to a main domain? It gives me an error and won't allow it even though I've changed my folder permission to 777. move_uploaded_file($_FILES["file_name"]["tmp_name"],"http://www.maindomain.com/titles/$new_file_name" ); It works though if I make the paths relative to the sub-domain. (I've got a development server dev.maindomain.com and all the paths are relative...so I made all absolute paths to write to but it doesn't work. I'm linuxed based..) Nathan
  13. BLAH! I found it.... HERE...wow it is so easy to miss a detail like this. '$credit6type')")
  14. I'm debugging a script and I get this SQL error but I'm scratching my head wondering why I'm getting it? Anybody know? I'm just not seeing it... :-\ You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1AT 781 credit_insert query. $title_name = mysql_real_escape_string($title_name); $credit1 = mysql_real_escape_string($credit1); $credit1type = mysql_real_escape_string($credit1type); $credit2 = mysql_real_escape_string($credit2); $credit2type = mysql_real_escape_string($credit2type); $credit3 = mysql_real_escape_string($credit3); $credit3type = mysql_real_escape_string($credit3type); $credit4 = mysql_real_escape_string($credit4); $credit4type = mysql_real_escape_string($credit4type); $credit5 = mysql_real_escape_string($credit5); $credit5type = mysql_real_escape_string($credit5type); $credit6 = mysql_real_escape_string($credit6); $credit6type = mysql_real_escape_string($credit6type); $credit_insert = mysql_query("INSERT INTO eg_credits(`id`, `title_name`, `user_name`, `ip`, `credit1`, `credit1type`, `credit2`,`credit2type`, `credit3`, `credit3type`, `credit4`, `credit4type`, `credit5`, `credit5type`, `credit6`, `credit6type`) VALUES ('$id', '$title_name', '$submit_user_name', '$ip', '$credit1', '$credit1type', '$credit2', '$credit2type', '$credit3', '$credit3type', '$credit4', '$credit4type', '$credit5', '$credit5type', '$credit6', '$credit6type'") or die (mysql_error() . "AT 781 credit_insert query.");
×
×
  • 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.