deinschanz
Gesperrt
Hilfe!
Hallo,
ich habe ein riesen Problem!
Ich möchte eine Zufallszahl ausgeben lassen und es klappt nicht
Hier der Qellcode
----------------------------------------------------------------------
1. test2.php
2.
3. <?
4. $mysql_host='localhost';
5. $mysql_username='????????';
6. $mysql_password='???????';
7. $mysql_db='????????';
8.
9. $result = mysql_query("SELECT za, zb FROM `testa`");
10.$myrow = mysql_fetch_row($result);
11.
12. $zufa = $myrow[0];
13. $zufb = $myrow[1];
14.
15.
16.
17. $points_login = rand($zufa,$zufb);
18.
19.
20. function login()
21. {
22. global $email, $password, $points_login;
23. $query="SELECT count(*) FROM autoaccounts WHERE
24. email='$email' AND password='$password' AND showup!='2' AND
25. showup!='3';";
26. $result=mysql_query($query);
27. if(mysql_result($result, 0)==1)
28. {
29. $sid=mt_srand((double)microtime()*1000000);
30. $query="UPDATE testb SET
40. punkte=punkte+$points_login ";
41. $result=mysql_query($query);
42. }
43. }
44. ?>
----------------------------------------------------------------------
Wo die Ausgabe erfolgt.
test.php
1. <?
2.
3. require('./test2.php');
4. if($email && $password)
5. login();
6.
7. $newsid=mt_srand((double)microtime()*1000000);
8.
9. echo $points_login;
10. ?>
----------------------------------------------------------------------
Leider in test.php wird ein Feller angezeigt:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/paid24ma/besucher24surf.de/member/gewinne/test2.php on line 10
Und eine 0 statt der Zahl!
Kennt sich jemand aus und könnte vieleicht den richtige Code posten?
Danke vorraus.
Gruß Widiger
Hallo,
ich habe ein riesen Problem!
Ich möchte eine Zufallszahl ausgeben lassen und es klappt nicht

Hier der Qellcode
----------------------------------------------------------------------
1. test2.php
2.
3. <?
4. $mysql_host='localhost';
5. $mysql_username='????????';
6. $mysql_password='???????';
7. $mysql_db='????????';
8.
9. $result = mysql_query("SELECT za, zb FROM `testa`");
10.$myrow = mysql_fetch_row($result);
11.
12. $zufa = $myrow[0];
13. $zufb = $myrow[1];
14.
15.
16.
17. $points_login = rand($zufa,$zufb);
18.
19.
20. function login()
21. {
22. global $email, $password, $points_login;
23. $query="SELECT count(*) FROM autoaccounts WHERE
24. email='$email' AND password='$password' AND showup!='2' AND
25. showup!='3';";
26. $result=mysql_query($query);
27. if(mysql_result($result, 0)==1)
28. {
29. $sid=mt_srand((double)microtime()*1000000);
30. $query="UPDATE testb SET
40. punkte=punkte+$points_login ";
41. $result=mysql_query($query);
42. }
43. }
44. ?>
----------------------------------------------------------------------
Wo die Ausgabe erfolgt.
test.php
1. <?
2.
3. require('./test2.php');
4. if($email && $password)
5. login();
6.
7. $newsid=mt_srand((double)microtime()*1000000);
8.
9. echo $points_login;
10. ?>
----------------------------------------------------------------------
Leider in test.php wird ein Feller angezeigt:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/paid24ma/besucher24surf.de/member/gewinne/test2.php on line 10
Und eine 0 statt der Zahl!
Kennt sich jemand aus und könnte vieleicht den richtige Code posten?
Danke vorraus.
Gruß Widiger