Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. Inserting and Updating are completely different things, I don't even know why your debating which one to use, they both have a separate purpose. Give us more information on what your doing. Your saying your updating every 10 minutes, so what are your inserting?
  2. This is such a common question, it has it's own thread dedicated to it. http://www.phpfreaks.com/forums/index.php/topic,95426.0.html
  3. <?php mysql_connect("localhost", "-----", "-------") or die(mysql_error()); mysql_select_db("games") or die(mysql_error()); $new_games = mysql_query("SELECT link, game_picture_url FROM game ORDER BY date_added DESC LIMIT 10") or die(mysql_error()); while($row2 = mysql_fetch_assoc($new_games)){ echo "<img src='{$row2['game_picture_url']}'><br>"; echo $row2['link'].'<p>'; } ?> Let me know if thats what your trying to do.
  4. The blue forum theme is completely different than the theme/colors of your site...so that doesn't look very good.
  5. You are wanting to insert into 3 fields, but you are giving 4 values. Your fourth value is random_string('alnum', 32)
  6. <?php $email = "email@gmail.com"; $ext = substr($email, -4); echo $ext; if ($ext == ".com"){ //do something } ?>
  7. It looks like you are registering their username on this line session_register("MM_Username"); Just as a note, unless your using an old version of PHP, you should be registering your sessions like this $_SESSION['MM_Username'] = "Their Username"; I'm assuming that their username is unique. So to get their information on another page, you would just do a query like this. <?php session_start(); $query = mysql_query("SELECT username, col, col3 FROM users WHERE username='{$_SESSION['username']}'")or die(mysql_error()); ?>
  8. Dodecahedron because it makes better dice for D&D Email or IM Can you really compare email and IM? I guess it really depends on who I need to talk to. If it is more for business, email. If it's a friend, then IM. Headache or Stomach Ache?
  9. Your getting the error from this line $row = mysql_fetch_array($result) Your missing the semi-colon at the end. Also, make sure your sanitizing the input from the URL before you use it in your query.
  10. .com - Who wouldn't rather have that? haha McDonads or Burger King?
  11. It doesn't matter as long as you start it and end it, then the name is ready to be used again.
  12. It's hard to give you good direction when we don't know exactly what your doing. Your solution will probably be JavaScript or AJAX.
  13. Try changing your code to this <?php include('Connect.php'); include('top.php'); $ID = $_COOKIE['UserID']; if (!isset($ID)) { echo "You must be logged in to view this page"; } include('bottom.php'); exit; $Result = mysql_query("SELECT * FROM users WHERE ID='$ID'") or die(mysql_error()); while ($Rows = mysql_fetch_array($Result)) { if ($Rows['story_area']=="1") { if ($Rows['gender']=="Male") { if (isset($_POST['submit'])) { echo "Announcer: The Pokébowl, who'll win it tonight folks? Over here we have the Charmanders!<br /> Captain: Char, Charmander *LETS GET HIM GUYS!*<br /> Announcer: And over here we have.. The Squirtles!<br /> Captain2: SQUIRT, SQUIRTLE!! *C'MON! BRING IT ON!*<br /> Announcer2: This will be a big game! Two rivals in the final match! Go go go!<br /> 58 minutes later..<br /> Announcer: This si a close one! 48-48 Tie game! The Squirtle captain ahs the ball! Hes going in for the kill! The 30, the 20, the 10, the 5! TOUCHDOWN!<br /> Announcer2: That was some game, bob!<br /> Announcer: Yes it was, Jim! 48- 54!<br /> Jimmy: That was a good game. but I think you should go home now.<br /> <form method='post'> <input type='submit' name='home' value='Head Home'></form>"; } else { echo "Jimmy: Hi, " . $Rows['username'] . "I'm heading to the Pokébowl later, wanna come? I got tickets! Front row center!<br />" . $Rows['username'] . ": Nah. I promised I'd help my mom with some chores..<br /> Jimmy: Aw! On Pokébowl night! C'mon! You gotta come!<br />" . $Rows['username'] . ": Hmm.. I guess my mom wouldn't mind. Okay, I'll go!<br /> <form method='post'> <input type='submit' name='submit' value='proceed'></form>"; } else { echo "Blah"; } else { echo "Blah 2"; } } } } include('bottom.php') ?>
  14. Indenting your code will make it a lot easier to find the problem. Your not closing your bracket to this line while ($Rows = mysql_fetch_array($Result)) { Or this line if ($Rows['story_area']=="1") { Here is an indented version of your code <?php include('Connect.php'); include('top.php'); $ID = $_COOKIE['UserID']; if (!isset($ID)) { echo "You must be logged in to view this page"; } include('bottom.php'); exit; $Result = mysql_query("SELECT * FROM users WHERE ID='$ID'") or die(mysql_error()); while ($Rows = mysql_fetch_array($Result)) { if ($Rows['story_area']=="1") { if ($Rows['gender']=="Male") { if (isset($_POST['submit'])) { echo "Announcer: The Pokébowl, who'll win it tonight folks? Over here we have the Charmanders!<br /> Captain: Char, Charmander *LETS GET HIM GUYS!*<br /> Announcer: And over here we have.. The Squirtles!<br /> Captain2: SQUIRT, SQUIRTLE!! *C'MON! BRING IT ON!*<br /> Announcer2: This will be a big game! Two rivals in the final match! Go go go!<br /> 58 minutes later..<br /> Announcer: This si a close one! 48-48 Tie game! The Squirtle captain ahs the ball! Hes going in for the kill! The 30, the 20, the 10, the 5! TOUCHDOWN!<br /> Announcer2: That was some game, bob!<br /> Announcer: Yes it was, Jim! 48- 54!<br /> Jimmy: That was a good game. but I think you should go home now.<br /> <form method='post'> <input type='submit' name='home' value='Head Home'></form>"; } else { echo "Jimmy: Hi, " . $Rows['username'] . "I'm heading to the Pokébowl later, wanna come? I got tickets! Front row center!<br />" . $Rows['username'] . ": Nah. I promised I'd help my mom with some chores..<br /> Jimmy: Aw! On Pokébowl night! C'mon! You gotta come!<br />" . $Rows['username'] . ": Hmm.. I guess my mom wouldn't mind. Okay, I'll go!<br /> <form method='post'> <input type='submit' name='submit' value='proceed'></form>"; } else { echo "Blah"; } else { echo "Blah 2"; } } include('bottom.php') ?>
  15. Are you sure you have any results with the lastlogin field is less than 30 minutes ago AND has the correct chatroom ID? Play with the query in your database and see if you can get any results by changing things around that you know will give results.
  16. Try SELECT * FROM users WHERE chatroom='$id' AND lastlogin > (NOW() - INTERVAL 30 MINUTE)
  17. Umm...neither. What would be the point of making it a sticky, it's nothing important. Are we trying to keep it at the top? I think it's going to stay at the top regardless of if we try or not. One Pillow or Two Pillows
  18. UPDATE users SET last_active=NOW() WHERE userID='$id'
  19. Okay, so you are wanting ONLY logged in members. Give the method I supplied above a shot, post if you have any problems implementing it.
  20. This code will count every user that is online, including "guests". I'm assuming from the OP using the word "member" they are wanting logged in users only.
  21. 1) Make a datetime field in your users table called something along the lines of "last_active" 2) On your header page (so it is called on every click) put an update query that will put the current date/time in the last_active field (this can be done using NOW()). 3) Your query to pull the users who have been active within the last 5 minutes will look something like this: SELECT username FROM users WHERE last_active > (NOW() - INTERVAL 5 MINUTE)
  22. Day off from work! Then during the day I will go buy the 10 pound bag of chocolate chips Burn to Death or Drown
  23. Try SELECT user FROM users WHERE birthday_date > (NOW() - INTERVAL 18 YEAR)
×
×
  • 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.