Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
Ok, then you're not getting any results from your database. Can I see the relevant code?
-
What's the error? If it's a header error please read this. Next time use code tags.
-
Use something like: $rand[]=rand(1,10); $rand[]=rand(1,10); $rand[]=rand(1,10); asort($rand); print_r($rand);
-
You should use and isset function instead.
-
Try something like: $sql = "SELECT * FROM forum_question fq LEFT JOIN forum_answer fa ON fq.id = fa.id WHERE fa.username = q_user' ORDER BY date DESC LIMIT 6"; You have to join on the common columns to prevent duplicates. It also ORDERS BY date DESC (if you have a date field or something similar) so it will grab the most recent posts and finally does LIMIT 6 which only grabs 6 records. Hope this is what you're looking for.
-
It's really impossible to help unless you show us some code that you get wrong results from. I don't see how overworking the server could result in wrong data, maybe slower, or poor performance, but not incorrect results. Give us a piece of code, and a random result? Is it possible your code contains errors that produces these incorrect results. Sorry if I'm not providing help but maybe someone else who understands what you're saying can answer your question.
-
Not sure what you mean by this, something similar to? LINK Then on the processing page to get that variable you would do something like: $var1 = $_GET['var1'];
-
[SOLVED] Need help with trim or some equivilent.
Maq replied to unrelenting's topic in PHP Coding Help
If the string are always going to begin with the rank then team name you can use: $s = "12. Cleveland St."; preg_match("/^[0-9]+/", $s, $match); echo $match[0]; ?> -
I'm not sure you want to use that, it's from 2004 and uses some old methods and like skunkbad said, it contains security flaws. Although, you could get some good design ideas from it.
-
Yes it's possible but you're doing it the wrong way. Look at the parameters for mysql_query(). You're giving it two strings (queries) when it only takes one. You would either have to use mysql_query() twice, or combine these queries. Can you explain what exactly you're trying to do, specifically what you're trying to extract from the database?
-
I agree with Mchl. I also think it's another "made up" holiday to force people to spend money.
-
I'm not going through your code but here are some pseudo solutions. When the page is submitted put the selected checkboxes in a array and just do count($array) > 'max' to ensure they don't select too many. You can use arrays. When you do your checks with PHP just keep adding to the array. i.e: if(count($array) > 5) { $errors[] = "Too many selected"; } Then at the end check to see if you have errors. If you do, display them, if not do whatever: if($errors) { foreach($errors as $error) { echo $error . " "; } else { echo "Successful"; } Hope this helps!
-
[quote author=fellixombc link=topic=54859.msg1141372#msg1141372 date=1237749320] [quote author=Maq link=topic=54859.msg1141322#msg1141322 date=1237745595] [quote author=fellixombc link=topic=54859.msg1141319#msg1141319 date=1237745424] Dreamweaver 8 ftw! [/quote] I've used Dreamweaver before, why is it so popular? I fail to see the big deal about it... [/quote] its easier to create divs and stuff. [/quote] Doesn't really seem like a valid reason as almost every editor has that feature...
-
Sure, sorry I just don't think I understood exactly what you wanted. Please mark as [sOLVED] if you're done, and maybe post the solution in case anyone else wants to reference it.
-
I did add that but still dont work It's not supposed to... It was for debugging purposes, does the echo print out the number '1'?
-
So change the tag values and values in your rows to the desired values from the result set.
-
The problem I think you're having is the fact that PHP lives on the server and javascript is a client side language. You cannot change the values of the PHP vars without refreshing the page. If you want to use JS you're going to have to use AJAX or you would have to refresh the page to get the new encrypted word.
-
Do you mean you want to select all values in a specific column that begin with 'winner'? SELECT * FROM table WHERE field LIKE 'winner%';
-
At the top of your script you can print out the whole session array: print_r($_SESSION); or you can just echo it out before your if statement: echo $_SESSION['user_type']; if($_SESSIONS['user_type'] == "1")
-
oo man, that's bad... I have to say I've had my fair share of dumb mistakes, we all do
-
</pre> <table> //put your header tags here while ($row=mysql_fetch_array($result)) { //columns and rows here just echo your $row results within the rows and columns } </
-
EDIT: beaten to it :-\
-
That means it's failing here: if($_SESSIONS['user_type'] == "1") { Have you echoed the session, specifically 'user_type', to ensure that it's 1, or even being set?
-
Sure. If you're getting into AJAX you mine as well check out some of the libraries they have to offer. Some popular ones: jQuery Scriptaculous MooTools Also please mark as [sOLVED].
-
[quote author=fellixombc link=topic=54859.msg1141319#msg1141319 date=1237745424] Dreamweaver 8 ftw! [/quote] I've used Dreamweaver before, why is it so popular? I fail to see the big deal about it...