Crazydog
12-06-2006, 12:12 AM
I'm starting to write this code, and I think I created an infinite loop somewhere, as when this code is run the page loads and never actually displays any info
<?php
$n=0;
$id=$_POST[$n.'add'];
include ('sql.php');
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die("Unable to select database");
$query="SELECT * FROM codes WHERE id='$id'";
$result=mysql_query($query);
if ($id != ''){
$id2=$_POST[$n.'add'];
while ($id2 != '' or $id2 == '') {
$email=mysql_result($result, 0, "email");
echo $email.'<br>';
$n++;
}
}else{
mysql_close();
}
?>
Here are my problems.
I have checkboxes, and
If I select the first checkbox, I get an infinite loop of $email being displayed.
If I select the first and second checkboxes, I get an infinite loop of $email (of the First checkbox) displayed.
If I don't select the first checkbox (With any other combination) nothing displays.
<?php
$n=0;
$id=$_POST[$n.'add'];
include ('sql.php');
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die("Unable to select database");
$query="SELECT * FROM codes WHERE id='$id'";
$result=mysql_query($query);
if ($id != ''){
$id2=$_POST[$n.'add'];
while ($id2 != '' or $id2 == '') {
$email=mysql_result($result, 0, "email");
echo $email.'<br>';
$n++;
}
}else{
mysql_close();
}
?>
Here are my problems.
I have checkboxes, and
If I select the first checkbox, I get an infinite loop of $email being displayed.
If I select the first and second checkboxes, I get an infinite loop of $email (of the First checkbox) displayed.
If I don't select the first checkbox (With any other combination) nothing displays.