Jump to content

Gotharious

Members
  • Posts

    159
  • Joined

  • Last visited

Everything posted by Gotharious

  1. 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
  2. Ok, thanks anyway
  3. 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
  4. 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;
  5. Maybe that would be better <html> <head> <title>Numbers - Christopher</title> </head> <body> <?php $var1 = 3; $var2 = 4; $var3 = ((1 + 2 + $var1) * $var2) / 2 - 5; ?> Basic Math: <?php echo $var3; ?><br /> </body> </html>
  6. That's because the echo doesn't calculate, it just posts it in the webpage in the browser
  7. You forgot the " in the echo use it like below Basic Math: <?php echo "((1 + 2 + $var1) * $var2) / 2 – 5"; ?><br />
  8. Nice Idea, will try that too
  9. 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
  10. I think you should check this particular post http://www.php.net/manual/en/control-structures.if.php#101724
  11. 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 } ?>
  12. 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
  13. 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" ){
  14. Thanks, guys you've been a great help
  15. 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
  16. Oh.... it's recruiteris not recruitis is that what's giving the error?
  17. 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; ?>
  18. oh, another question. so after using this code, I take the $array and use it in another query below that, right?
  19. Ok, I'll try it your way then pikachu will let you know if it worked
  20. Lol perhaps you should mark this as solved
  21. 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
  22. not sure about the select user code, but the query to update record would be something like <?php $query = mysql_query("UPDATE tablename SET firstname = '$firstname' AND LastName = '$lastname" WHERE id = '$id'); ?>
  23. 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
  24. Mostly I've seen people use ajax to validate while the user is complete the form before hitting submit, perhaps you'd try that
  25. Oh, and please mark this thread as solved once you solve your problem
×
×
  • 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.