Creating a radio button set based off of PHP/MySQLHaving an issue with a button being checked on default:What it looks like:
The code:\[code\]$first = TRUE;if (mysql_num_rows($result)){ for ($j = 0; $j < mysql_num_rows($result); $j++) { $currentCat = mysql_result($result, $j, 'category'); if ($first == TRUE) { $first = FALSE; echo "<input type='radio' name='createCat' value='http://stackoverflow.com/questions/15725697/$currentCat' checked='checked' />$currentCat checked"; } else { echo "<input type='radio' name='createCat' value='http://stackoverflow.com/questions/15725697/$currentCat' />$currentCat "; echo "non"; } } echo <<<_END <br /><input type='submit' value='http://stackoverflow.com/questions/15725697/Create' /> $error </form>_END;}\[/code\]Notice how the first box isnt checkedThe output in HTML:\[code\]<input type='radio' name='createCat' value='http://stackoverflow.com/questions/15725697/opt1' checked='checked' />opt1 checked<input type='radio' name='createCat' value='http://stackoverflow.com/questions/15725697/opt2' />opt2 non<input type='radio' name='createCat' value='http://stackoverflow.com/questions/15725697/Accounts' />Accounts non <br /><input type='submit' value='http://stackoverflow.com/questions/15725697/Create' /> \[/code\]