Jump to content

nbst

Members
  • Posts

    6
  • Joined

  • Last visited

nbst's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. What do you mean "not quite"? It was your code, so how does it not being what it should have been make me wrong? The parameter order was wrong even if the parameters weren't what they should have been. I was aiming to fix your syntax errors and it looks like my advice did just that. If I'm missing something, do let me know. nbst
  2. You are trying to execute a function in the middle of a string, so it simply makes sense semantics-wise to separate them. However, you could of course do this: $date = date("Y", strtotime($mywhen)); $monthQuery = "SELECT * FROM calendar WHERE mywhen >= CURDATE() AND YEAR(mywhen) = '$date' GROUP BY MONTH(mywhen) ORDER BY mywhen"; nbst
  3. There are many issues present here, but for actually getting it to work: Are you not receiving any errors? Place error_reporting(-1); right below the opening <?php line just to be sure. Do you have the database table created with a schema that lines up with what is in the query? The header() call should use parentheses and not brackets. nbst
  4. nbst

    foreach error

    Since the warning specifies the invalid argument is located in the foreach, you can ignore the do...while loop and the $nextrow and $lines variables. It has to do with what $array contains. It must not actually be an array, so it's likely either NULL or FALSE, from what I've just read in the docs. Try doing checks on the array variable, testing if it is empty, false, or null before you run the foreach loop which assumes that it is an array. Also, the docs seem to use a while() loop with fgetscsv(). You might want to look into that. nbst
  5. You have to execute it, like with the other query. $result = mysql_query($query) or die(mysql_error()); Place that below the last line. nbst
  6. Flip the parameter order of both array_filter() function calls. That should fix all of the warnings. E.x. $textLines = array_filter('trim', $textLines); to $textLines = array_filter($textLines, 'trim'); nbst
×
×
  • 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.