
Gotharious
Members-
Posts
159 -
Joined
-
Last visited
Everything posted by Gotharious
-
Yes, you need to install a mail server or use a remote one if you have a hosting account somewhere if you have outlook installed, and you configured an email address there and using it, if you know the SMTP server and such, you can just head to your php.ini file and change to that email server instead of local host
-
Ok, thanks anyway
-
I want the result of the first query to be used in the second and so on for example, search for user id from users where recruiterid = 1 so I get 2 results 2 and 3 so the second query search for user id from users where reruiterid= 2 and so on and the result of each query would be used in the query after
-
Hey all, I get many warnings saying "Warning: extract() [function.extract]: First argument should be an array in /home/www/waw-eg.com/Users.php on line 93 Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/www/waw-eg.com/Users.php on line 93" while($row = mysql_fetch_array($result)) { $query = "SELECT ". " (SELECT COUNT(*) FROM users WHERE recruiteris = ".$row['id'].") AS count_1,". " (SELECT COUNT(*) FROM users WHERE recruiteris = count_1) AS count_2,". " (SELECT COUNT(*) FROM users WHERE recruiteris = count_2) AS count_3,". " (SELECT COUNT(*) FROM users WHERE recruiteris = count_3) AS count_4,". " (SELECT COUNT(*) FROM users WHERE recruiteris = count_4) AS count_5,". " (SELECT COUNT(*) FROM users WHERE recruiteris = count_5) AS count_6,". " (SELECT COUNT(*) FROM users WHERE recruiteris = count_6) AS count_7,"; $res = mysql_query($query); extract( mysql_fetch_assoc($res) ); $total = $count_1 + $count_2 + $count_3 + $count_4 + $count_5 + $count_6; $var3 = '10'; $commission = $total * $var3;
-
Nice Idea, will try that too
-
Well, not sure about that one, but when I wanted to do something like that before I used a header instead of an echo, so it redirects the user to a different page, just pure html that shows a message with the error and a link to get back to the previous page not sure if that would help you tho
-
I think you should check this particular post http://www.php.net/manual/en/control-structures.if.php#101724
-
you mean something like that? <?PHP $res1needed = "10"; $res2needed = "20"; $tp = "30"; if( ($res1needed == 10 || $res2needed == 20 || $tp == 30) { //do something } else { //do something else } ?>
-
Ok, please correct me if I'm wrong What you want is 1. a check if the user has a certain amount of offence or defence to go to the next level (example: level one 100 offence 100 defence, level 2 is 200 offence and 200 defence) 2. if he has enough resources it should say, you can't add more resources? please help me get the picture with an example
-
You set if count = or less than three it would let him register <? $sql = "SELECT COUNT(email) FROM j5_maillist AS aantalEmails"; $result = mysql_query($sql); if( mysql_num_rows($result) <= "3" ){ $message = 'you are one of the 100 first people '; } else { $message = 'sorry, to late '; } ?> You should set that to 100 if( mysql_num_rows($result) <= "100" ){
-
Thanks, guys you've been a great help
-
Ok thanks, Sean. How you think is the best way to make that kind of multiple queries? hence they are all on the same table tho
-
Oh.... it's recruiteris not recruitis is that what's giving the error?
-
Help with Downline, shows parent but not child
Gotharious replied to Gotharious's topic in PHP Coding Help
I'm not sure if this is right, but I get no results from this <?php function GetDownline($member_id,$direction) { $query = ("SELECT id, recruiteris, position FROM `users` WHERE recruiteris = '$member_id' AND position = '$direction'"); if( !$result = mysql_query($query) ) { echo "<br>Query: $query<br>Failed with error: " . mysql_error(); return FALSE; } else { $array = mysql_fetch_assoc($result); $getdownline = $array['id']; return $getdownline; } } //then simply call it with: $firstleft = GetDownline('headmemberidhere','Left'); //for first left $firstright = GetDownline('headmemberidhere','Right'); //for first right echo $firstleft; echo $firstright; $secondleftofleft = GetDownline($firstleft,'Left'); //for second left of first left $secondrightofleft = GetDownline($firstleft,'Right'); //for second right of first left echo $secondleftofleft; echo $secondrightofleft; $secondleftofright = GetDownline($firstright,'Left'); //for second left of first right $secondrightofright = GetDownline($firstright,'Right'); //for second right of first right echo $secondleftofright; echo $secondrightofright; ?> -
Help with Downline, shows parent but not child
Gotharious replied to Gotharious's topic in PHP Coding Help
oh, another question. so after using this code, I take the $array and use it in another query below that, right? -
Help with Downline, shows parent but not child
Gotharious replied to Gotharious's topic in PHP Coding Help
Ok, I'll try it your way then pikachu will let you know if it worked -
Lol perhaps you should mark this as solved
-
There are few things about php, that are so simple but drives you nuts make you sometimes feel like you want to stop trying, and then suddenly, browsing online you find the answer and PHP is all fun again. I think what you should do, instead of just asking people for help in a code, and then take their input and that's it, is to understand why it didn't work before, and why it now works, if you understand that, you will be able to relate when you encounter a similar problem and be able to figure out the problem. Or you can get a ps3, start playing pro evolution and win for Newcastle... sounds more fun lol
-
I'm not sure about that, but I get that a lot too, perhaps using the same php version in live and local environments would solve this problem, not sure tho
-
If [form validated] submit Form1 ELSE submit Form2?
Gotharious replied to jonnewbie12's topic in PHP Coding Help
Mostly I've seen people use ajax to validate while the user is complete the form before hitting submit, perhaps you'd try that -
Oh, and please mark this thread as solved once you solve your problem