} else {
echo("Oeps! None of the boxes selected.");
}
}
------------------------------------
When i select a box and post the form i get the following error:
Warning: Supplied argument is not a valid MySQL result resource in /opt/guide/www.webselect.nl/HTML/voorbeeld.php3 on line 30
Line 30 is the following piece of code:
while ($myrow = mysql_fetch_array($result))
Hmm. It looks as if you missed a single quote right after $opstartcd.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
if ($opstartcd)
{if ($webmail) $sql .= "AND ";
$sql .= "opstartcd = '$opstartcd' ";}
[/code]
Whenever I'm havnig trouble with SQL statements, I just print it out on the page and examine it rather than guess if it's the problem within the script. Like:
echo "<h1>".$sql."</h1>";
That solves the problem.
I'm a bit new to php and especially the "echo <h1>'$sgl etc. function is great.
Greetings from The Netherlands. (a lot of wind and about 20 degrees Celcius <= that's summer :-)
Bookmarks