Jump to content

pengu

Members
  • Posts

    154
  • Joined

  • Last visited

    Never

Everything posted by pengu

  1. Change $email = $_POST['email]; To $email = $_POST['email']; You forgot a '
  2. You would need a field in the database to reflect this, if you really wanted to do it that way. (time consuming IMO) Do as stated above by chintansshah, use the page.php?id=ID and then that page can grab all the information from the database where the id = the id you have selected. You should notice with all your links that the ?id=X are all different. -Pengu
  3. Output all your variables, echo them. Make sure they are all being populated.
  4. You need an inner join. $sql = mysql_query("SELECT c.field1,e.field2 FROM comments AS c INNER JOIN example AS e ON c.quoteid = e.quoteid WHERE c.approved LIKE 'n%'");
  5. There are some great tutorials on this website. Click here : http://www.phpfreaks.com/tutorial/basic-pagination
  6. Perhaps posting your full code may be of assistance.
  7. Look into the $_GET function. Also mysql_real_escape_string($variable)
  8. I think you need a PABX system for all this to happen.
  9. Nevermind. GROUP BY ftw, figured it out.
  10. Alright what I'm aiming to do here is integrate PHPBB forums with my own PHP project I'm writing up, after going through a few tutorials I got this all sorted out, nice and easy really. The problem I'm having now is I'm trying to do a news page, I have setup my forums to have a Category and under that category I have a forum called "news", what I want to display is the topics only, not the posts and I've written up a query but it's displaying all the posts, rather than the topics only. SELECT phpbb_topics.topic_id, phpbb_topics.topic_poster,phpbb_users.username, phpbb_posts.post_subject, phpbb_posts.post_text FROM phpbb_topics INNER JOIN phpbb_posts ON phpbb_topics.topic_id = phpbb_posts.topic_id LEFT JOIN phpbb_users ON phpbb_topics.topic_poster = phpbb_users.user_id WHERE phpbb_topics.forum_id = 26 AND phpbb_topics.topic_type = 0 ORDER BY phpbb_topics.topic_id DESC LIMIT 0 , 10 Just need some help on how to make it bring up only topic items! Hope you can help. - Pengu
  11. Change. $result = mysql_result($get, 0); To. $result = mysql_result($get, $con);
  12. You have answered your own question mate, practice! Instead of starting a new project, why not see how you can improve your guest book application, why not write up an administration panel for it?
  13. PHP + MySQL This has been doing my head in, it has to be possible how I think it is. The thing I am trying to achieve here is let's say a list of users logged in. Now if every one would click logout and use the system correctly the world would be a better place, but they wont, we all know this. So I was thinking how to counter this and I came up with an idea, lets say in our users table we have an "ACTION" field as a timestamp (or datestamp??). So everytime the user does anything on my site, edit there profile, browse something etc etc, it updates the "ACTION" field to the current time. I was thinking in the background I could have a cron job run every.. 5 minutes? Is it possible to have it check EVERY users ACTION field and if there ACTION field is less than the current time - 5 minutes, it updates there LOGGED_IN field to like 0, which would mean they're actually not logged in anymore and would not appear in the logged in list. Someone tell me yes or no! (The main problem being having to constantly update that ACTION field)
  14. You will need a LEFT JOIN. SELECT t2.Airport FROM Table1 AS t1 LEFT JOIN Table2 AS t2 ON t1.Airport = t2.ICAO /** Possible to add a WHERE clause, if you only want to select one airport **/
  15. If you have a login system this should be really easy for you, I should hope. You just need a couple of queries. Maybe add another field for your table and call it RSSChecked, it can be either 1 or 0. Do a query to get the RSSChecked field, if it's a 0 Do this.. <?php $sql = "UPDATE users SET points = points + 10 WHERE username = 'username' "; ?> If it's a 1, do nothing.
  16. I don't think it will work, but I never use brackets with include.. <?PHP include 'myfile.php'; ?> All you need
  17. http://www.phpfreaks.com/tutorial/working-with-dates-in-php Some great tutorials on this website.
  18. I think your first step would be to post it in the correct forum. They have a forum dedicated to AJAX questions.
  19. echo "<option>" .$row['field1]. "</option>"; Should be.. echo "<option>" .$row['field1']. "</option>";
  20. <?PHP $con=mysql_connect(DB_HOSTNAME,DB_USERNAME,DB_PASSWORD); mysql_select_db(DB_DATABASE, $con); $sql = "SELECT field1 FROM table"; $result = mysql_query($sql,$con); ?> <form> <select> <?PHP while($row = mysql_fetch_assoc($result)) { echo "<option>" .$row['field1]. "</option>"; } ?> </select> </form> Something like this would work.
  21. pengu

    Error!

    In slider.php on line 19. How forgetful guys.
  22. Another bump. I've come back to this project and I need to achieve this.
  23. Yeah, I'm not sure what the OP wanted either. As far as I could tell it was count of both of those fields.
  24. Can't edit my damn post.. I meant this. SELECT COUNT( id ) AS ACount, (SELECT COUNT( search_price ) FROM products WHERE for_sale = "yes") AS BCount FROM basket WHERE ip_address = "'.$_SERVER["REMOTE_ADDR"].'"
×
×
  • 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.