Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. Oh, and your other one. SELECT u.name, u.useavatar, u.avatarfile, DATE_FORMAT(`timestamp`,'%b %e, %y, %r') AS formatted_time FROM user u LEFT JOIN memberscomments c ON (u.id = c.userid) ORDER BY `timestamp` DESC LIMIT 5 You don't really need toi use aliases unless two fields are going to conflict. Also, I would avoid naming fileds using reserved words like date and timestamp, this way you don't need all those ugly backticks.
  2. Ok, so your first join will want to join users to there comments. SELECT u.name, c.comment FROM users u LEFT JOIN memberscomments c ON (u.id = c.userid) I have aliased the user table to u and the memberscomments table to c. This should give you a pretty easy example of how joins are done. Now, why do you have two name fields? Also, don't use SELECT *, you should specify the fields you want.
  3. That first query is not going to help. We need to see your table schemas. Your selecting * which again does not help.
  4. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=359523.0
  5. This post explains the concept pretty simply.
  6. Because they are not actually set until your script has finished executing and the headers are sent ( this is what actually sets the cookies).
  7. Storing serialised (or even simple comma separated data) data is never a good idea for this very issue. It's nopt something that is easily searched or manipulated using a database. Whatever that data is, if it needs to be stored in a database there is a better way.
  8. You might want to narrow your problem down somewhat. Saying sorry for posting too much code just means that you yourself are aware you have posted too much code. Fix it.
  9. That is indeed the case. Once you create your cookie, redirect the page back to itself.
  10. Once you set your cookie, redirect back to the current page.
  11. This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=359538.0
  12. I don't see how this relates to php at all. You already said your using jQuery.
  13. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=359534.0
  14. The error is pretty self explanatory. The user "application" does not have permission to access mysql using the password "application" from localhost.
  15. Where are you trying to store comma separated id's? If it's a database, why?
  16. This topic has been moved to Other Web Server Software. http://www.phpfreaks.com/forums/index.php?topic=359470.0
  17. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=359491.0
  18. Another option is to look at one of the many "dependency injection" libraries around. Using these, your classes depend on a single "DI Manager" object, which in turn, stores all your dependencies. Proem has one (there is a link in my signature) but there are also numerous stand alone options around.
  19. If you have a class that depends on the Page class, the Page class should be passed in via dependency injection. This means you either pass it into the __construct, or create a specialised method for passing it into the object.
  20. It expects a DateTime object. it has nothing to do with the fact that your mysql datatype is datetime or not.
  21. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=359434.0
  22. trq

    2 logins

    More than likely it's because your paths have changed and php can't find some libraries or whatever. Anyway, it's a pretty weird idea and pretty bad practice IMO to have two complete copies of the website just to make it work on a mobile device.
  23. HTML does not have an interface to anything, it's not a programming language. Why can't you use PHP? I understand what you want, but as I said, HTML is not a programming language. How exactly do you expect to check if a user is logged in or not using HTML?
×
×
  • 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.