Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. SELECT news.post_id, news.title FROM news WHERE Blog_Type = 'Food' AND record != 1 ORDER BY news.post_id DESC LIMIT 6
  2. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=351877.0
  3. You'll need to wrap both function calls in another function and call that. Better stil, you should be using unobtrusive JavaScript so that your events aren't mixed in with your markup.
  4. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=351832.0
  5. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=351844.0
  6. Why are you opening multiple connections? A single connection would be better, but 14 queries is nothing.
  7. Yeah there is a limit, not exactly sure what it is though. Maybe 10 - 15 posts.
  8. Is this data coming form a database or something or are these links actually within a file?
  9. And where exactly are you stuck? Code would be helpful. The general idea would be something like: $out = array(); while ($row = $result->fetch_assoc()) { $out[] = $row; } echo json_encode($out); Obviously you would need to format the $out array into whatever format you need though.
  10. There is nothing in that rule that says your urls need to contain .php anywhere.
  11. What is with all the backslashes? That is not at all valid JavaScript.
  12. Someone sounds pretty excited about something Welcome to the boards.
  13. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=351799.0
  14. Java is not JavaScript. You have also posted your code in the manual [m][/m] tags making it unreadable.
  15. While your problem is with your query you have a logic issue here. if (!$result=) { echo "Could not successfully run query ($result) from database" . mysql_error($con); } If $result is false you echo an error message. this is good, however, you never stop your code from going into the next part: if (mysql_num_rows($result) == 0) If $result is false, you will always get an error here because (as I have already explained) mysql_num_rows expects a result resource. Nothing else can be passed to it.
  16. Or better still, handle your errors properly. An example: if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { // $result is now good to use } else { // no results found } } else { trigger_error(mysql_error()); }
  17. Firstly, I haven't looked at your code because I won't download code. Anyway, your error is very common and is caused by passing the results of a call to mysql_query() straight into mysql_num_rows() without first checking to see that your query has succeeded. mysql_num_rows() expects a result resource, while mysql_query() will return a result resource on success or the boolean false on failure. For some reason, your query is failing. What does mysql_error have to say?
  18. Yeah SwiftMailer is the component that Symfony2 uses. I was going to suggest using Zend's Mail components but it would have been more of a hassle to pull out of the framework.
  19. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=351796.0
  20. You want to GROUP BY, not DISTINCT.
  21. It shouldn't. How exactly have you set it up?
  22. nl2br already coverts newlines to <br /> tags. You shouldn't do this on the way into the database however, only on the way out.
  23. Don't you mean you want to ORDER BY seq from the other table? Either way you need a JOIN. SELECT id, `group`, cid, u, `date`, id_ FROM xernt_mailing LEFT JOIN othertable USING(cid) WHERE date <= "2012-01-14 19:32:17" AND `group` = 1 AND u = 6 ORDER BY seq DESC
  24. This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=351779.0
  25. Don't put it in the loop then.
×
×
  • 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.