mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /ho
eelco
20/07/2004 13:58:00Ik heb nog 1 probleem, in dit script zit op regel 11 een fout:
DE SITE
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php session_start();
//-----------------------------------------------------
// SELECTEER URL --------------------------------------
include("inc_connect.php");
$query = "SELECT * FROM surfbar";
$result = mysql_query($query) or die("FOUT: " . mysql_error());
$aantal = mysql_num_rows($result) or die("FOUT: " . mysql_error());
$toss = rand(1,$aantal);
$query = "SELECT * FROM surfbar WHERE id ='$toss'";
$result = mysql_query($query) or die("FOUT: " . mysql_error());
// REGEL 11
while(list($id, $naam, $email, $wachtwoord, $url, $credits, $ref, $uitgeven, $uitgegeven, $ip) = mysql_fetch_row($result)){
$query = "UPDATE surfbar SET credits = credits+0.8 WHERE id='$_GET[id]'";
$result = mysql_query($query) or die ("FOUT: " . mysql_error());
$query = "UPDATE surfbar SET uitgeven = uitgeven-1 WHERE url='$url'";
$result = mysql_query($query) or die("FOUT: " . mysql_error());
?>
//-----------------------------------------------------
// SELECTEER URL --------------------------------------
include("inc_connect.php");
$query = "SELECT * FROM surfbar";
$result = mysql_query($query) or die("FOUT: " . mysql_error());
$aantal = mysql_num_rows($result) or die("FOUT: " . mysql_error());
$toss = rand(1,$aantal);
$query = "SELECT * FROM surfbar WHERE id ='$toss'";
$result = mysql_query($query) or die("FOUT: " . mysql_error());
// REGEL 11
while(list($id, $naam, $email, $wachtwoord, $url, $credits, $ref, $uitgeven, $uitgegeven, $ip) = mysql_fetch_row($result)){
$query = "UPDATE surfbar SET credits = credits+0.8 WHERE id='$_GET[id]'";
$result = mysql_query($query) or die ("FOUT: " . mysql_error());
$query = "UPDATE surfbar SET uitgeven = uitgeven-1 WHERE url='$url'";
$result = mysql_query($query) or die("FOUT: " . mysql_error());
?>
DE SITE