Hello,
I've got three checkboxes on which i want to search for results in my database. Code:
---------------------------
if ($submit) {
if ($webmail | | $opstartcd | | $telnet) {
$sql = "SELECT * FROM access WHERE ";
if ($webmail)
{$sql .= "webmail = '$webmail ";}
if ($opstartcd)
{if ($webmail) $sql .= "AND ";
$sql .= "opstartcd = '$opstartcd ";}
if ($telnet)
{if ($webmail | | $opstartcd) $sql .= "AND ";
$sql .= "telnet = '$telnet ";}
$result = mysql_query($sql);
{
echo "<table border=1>
";
echo "<tr><td>Bedrijf</td><td>Pakket</td><td>Type</td><td>Regio</td></tr>
";
while ($myrow = mysql_fetch_array($result)){
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>
",
$myrow[bedrijf], $myrow[pakket], $myrow[type], $myrow[regio]);
}}
} 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))
I don't see the problem. Do you?
Great thanks,
Joep
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks