Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. And here's mine, you should read the previous posts so you don't post redundant suggestions that have already been rendered useless.
  2. What did the $sql echo out? Can you post where you're calling it and what you're passing in...
  3. Before I do anything I would advise you to do two things... 1) Put your queries in strings so you can easily debug: 2) Put or die(mysql_error()); at the end of your queries so it displays any errors, which you claimed not to have any. function Update($npass, $username){ $npass=md5($npass); $sql="UPDATE users SET password='$npass' WHERE username='$username'"; echo $sql; mysql_query($sql) or die(mysql_error()); }
  4. Bob-Marley, If you read the previous posts we decided not to do that because some of the id's don't exist because they have been deleted.
  5. Sorry, I'm not sure what that is... You may need to post more relevant code.
  6. I think you can check to see if it's the first or last by simply checking to see if your query returned anything: if($newidresult) { $newid = mysql_fetch_assoc($newidresult); $previd = $newid['id']; }
  7. Do it in sell.php: $item = $_GET['item']; UPDATE table SET item_count = item_count - 1 WHERE item = $item You need to give more information...
  8. Would you relax? You sound this is a life threatening problem... What are we supposed to do, guess? Show us some code!
  9. I echoed out $newidquery, let me know what it says. $id = $_GET['id']; $cmd = $_GET['cmd']; if(isset($cmd)) { if ($cmd == 'prev') { $newidquery = "SELECT id FROM table WHERE id > $id ORDER BY id LIMIT 1"; echo $newidquery; $newidresult = mysql_query($newidquery) or die(mysql_error()); $newid = mysql_fetch_assoc($newidresult); $previd = $newid['id']; } else { echo "it's not previous ;("; }
  10. 1) Always put or die(mysql_error()) at the end of your query calls to make sure you don't have an error. 2) You need to get $cmd via $_GET first. 3) Let's start with previous... $cmd = $_GET['cmd']; if ($cmd == 'prev') { $newidquery = "SELECT id FROM table WHERE id > $id ORDER BY id LIMIT 1"; $newidresult = mysql_query($newidquery) or die(mysql_error()); $newid = mysql_fetch_assoc($newidresult); $previd = $newid['id']; } else { echo "it's not previous ;("; } ?> Previous
  11. Don't worry, we all have those kinds of days...
  12. You should have both incase the user turns off JS.
  13. Swirls...? I don't like swirls.
  14. You will never be able to get queries or any server side code for that matter. It all just gets rendered to HTML and put on the browser.
  15. Is this all you get? Because this line: or die('Error, query failed: '.mysql_error()); Should give you more of a specific error...
  16. Have you tried my suggestion?
  17. Then you're better off making a pop-up window rather than an alert. The problem with that is pop-up windows aren't modal. Although there may be a setting but not to my knowledge.
  18. You're welcome
  19. What's the schedule? Every first of the month? If so, just set up a cronjob (or scheduled task for windows) in your crontab that runs every 1st of the month and updates the database.
  20. ^--- Yep. That way your relative paths will be portable on any server.
  21. I think they should change the board title to like, "Core PHP Development" or something. Although, I must admit, I actually LOVE it when people "how 2 hack dis" threads in here because they make my day. I love how people misinterpret the word "hack" so much... But I also have to admit, it is pretty funny.
  22. Ever since I've been here, which hasn't been that long, I have only seen 2 computer related threads... I agree with wildteen in that, I think it would be better to leave that to the Miscellaneous section...
  23. Until you start moving pages from server to server...
  24. Kind of harsh wouldn't you say? You sure like flaming people Sorry to be like this but when people double post it irritates me. It wastes everyone elses time and is ignorant. So, as far as your question, "Kind of harsh wouldn't you say?", my answer is NO. Flaming? Far from it...
  25. No. It's not the same exact post but he asked the same question later... http://www.phpfreaks.com/forums/index.php/topic,231345.msg1076862.html#msg1076862
×
×
  • 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.