Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
Use RAND() in your query.
-
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.
-
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."; }
-
There's nothing telling the text not to output. Every time that page is called "This is some text", is going to display.
-
Code please?
-
Have a look at the sticky at the top of this board. http://www.phpfreaks.com/forums/index.php/topic,117475.0.html
-
He already did.
-
A HREF - need to link files from data base. help please
Maq replied to applebiz89's topic in PHP Coding Help
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']} "; -
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.
-
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.
-
Please see the link: www.menopauseinfo.org
-
Yeah depends on your style and website, but here's a quick list from, surprise, google! JS Galleries
-
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.
-
Why did this php page consume almost 100% of a huge server's CPU time?
Maq replied to kisazeky's topic in PHP Coding Help
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... -
Why did this php page consume almost 100% of a huge server's CPU time?
Maq replied to kisazeky's topic in PHP Coding Help
Which loop did you add the $i++ into? There are 2 while loops.. -
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?
-
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.
-
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?
-
[SOLVED] Php includes causing bad design issues
Maq replied to CLTaylor's topic in PHP Installation and Configuration
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. -
[SOLVED] Php includes causing bad design issues
Maq replied to CLTaylor's topic in PHP Installation and Configuration
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. -
Your query is failing replace this line with: $result=mysql_query($sql) or die(mysql_error()); And please use tags around code.
-
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.
-
Yes this is possible. What part are you having trouble with?
-
There is a method in creating a scalable easy to maintain database. It's called Database Normalization.
-
This may be helpful: http://www.phpfreaks.com/forums/index.php/topic,117475.0.html