Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Use RAND() in your query.
  2. Sure. This will work well for your small example, but if you were to write a bigger script or application there could be a better solution depending on certain factors. You should always think ahead and create a good model and design for your application.
  3. Get rid of the, "This is some text", and replace it with $body. There's no need for a function here, but I assume you're going to use this for a bigger script so I'll leave it. if ($_GET['task'] == "hello") { $body = hello(); } else { $body = "This is some text"; } function hello() { return " Hi. Thanks for clicking me."; }
  4. There's nothing telling the text not to output. Every time that page is called "This is some text", is going to display.
  5. Have a look at the sticky at the top of this board. http://www.phpfreaks.com/forums/index.php/topic,117475.0.html
  6. He already did.
  7. Looks like your adding 2 to $num_found because you have $i++ in the loop then you add one again within the loop. For a link, try something like: echo "$num_found {$row['filename']} ";
  8. First 5 things I checked on Google gave me the same detailed explanation of how Digital Clocks work. I think a little effort and he could have gotten the answer himself. Sure, why not? Besides, it will teach him how to figure things out on his own.
  9. If you have 1 row then the most that mysql_affected_rows() can be, is 1. This doesn't have anything to do with users. If you don't provide the function with a result_resource it will, by default, grab the last result resource that was executed.
  10. Please see the link: www.menopauseinfo.org
  11. Yeah depends on your style and website, but here's a quick list from, surprise, google! JS Galleries
  12. Maq

    Joining Tables

    I was implying that you should normalize your tables before you have a debacle on your hands. There's no point in writing a query when you don't even know how to design a proper database. A bad design will only lead to larger problems in the future. But you know all this already, right? So if you want to rig up your script to compensate for your poor design then, by all means, let's go right ahead, I love hacking up other people's code.
  13. That shouldn't cause an infinite loop. Although, I don't get the point of a while loop when it's only going to loop once...
  14. Which loop did you add the $i++ into? There are 2 while loops..
  15. Maq

    HELP NEEDED

    This usually means that the query is failing. What exactly does it say when you put the or die statement at the end of the query call?
  16. Please don't double post, someone could have moved it for you if you requested it. Like I said in your other post, we can only see the final HTML with that link. You're including your file in the wrong spot. We would need to see the relevant code.
  17. Maq

    HELP NEEDED

    Are your passwords encrypted with anything before you insert them in the database? Have you actually looked inside the database to see if what you expect to happen should occur? What's the exact error/problem?
  18. Not much we can do with that link. The only thing we can look at is the view source which gives us pure HTML. I assume this is a PHP page, could you maybe post the actual code that is giving you trouble? Seems like you're just including/requiring them in the wrong place.
  19. What page? What include files? What do you mean by, "freak out"? Are you sure this is an Installation/configuration problem, doesn't sound like one.
  20. Maq

    HELP NEEDED

    Your query is failing replace this line with: $result=mysql_query($sql) or die(mysql_error()); And please use tags around code.
  21. r.*, m.postcount, m.replycount Select everything from the Replies table and only postcount and replycount from the Members table. Replies r, Members m These are just aliases for the table names. Instead of typing them out fully every time you can just alias them to a letter(s). r.postid = $postid AND m.username = r.username Here he's matching up common fields so there are no duplicates. ORDER BY time ASC This is pretty self explanatory but he's ordering by the time in ascending order. Hope this helps.
  22. Yes this is possible. What part are you having trouble with?
  23. Maq

    Joining Tables

    There is a method in creating a scalable easy to maintain database. It's called Database Normalization.
  24. This may be helpful: http://www.phpfreaks.com/forums/index.php/topic,117475.0.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.