genzedu777 Posted November 5, 2010 Share Posted November 5, 2010 Hi, After adding this code, I received an error. Anyone can advise what is the possible reason? Thanks "Parse error: syntax error, unexpected $end in D:\inetpub\vhosts\championtutor.com\httpdocs\tutor_registration.php on line 594" <?php /***Teaching Credentials***/ echo '<label for="teaching_credentials" class="label">Teaching Credentials</label>'; $dbc = mysqli_connect('localhost', '111', '111', '111') or die(mysqli_error()); $query = ("SELECT * FROM tutor_teaching_credentials ORDER BY credentials_id ASC"); $sql = mysqli_query($dbc, $query) or die(mysqli_error()); while($data = mysqli_fetch_array($sql)) { echo '<select name="teaching_credentials" id="teaching_credentials"> <option value="">--Please select one--</option> <option value="'.$data['credentials_id'].'">'.$data['credentials_name'].'</option></select>'; mysqli_close($dbc); ?> Quote Link to comment Share on other sites More sharing options...
OldWest Posted November 5, 2010 Share Posted November 5, 2010 Which line is 594 ? Possible causes: 1) Badly placed or missing curly braces.. 2) If this is part of a larger class, and you segmented the code with <?php ?>, could cause this. 3) Using short tags <? ?> instead of <php ?> possibly on something that is tied into this script or page. My suspicion tells me to start looking at this line: <option value="'.$data['credentials_id'].'">'.$data['credentials_name'].'</option></select>'; Quote Link to comment Share on other sites More sharing options...
rwwd Posted November 5, 2010 Share Posted November 5, 2010 missing the closing curly in the while judging from what you have posted, and the structure you have there.. BTW, you need to construct the <select> OUTSIDE the loop, it's the <option></option> that needs to be looped through in this instance from what I can see here. Rw Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 5, 2010 Share Posted November 5, 2010 The default <option value="">--Please select one--</option> should also be outside of the while loop. Quote Link to comment Share on other sites More sharing options...
genzedu777 Posted November 5, 2010 Author Share Posted November 5, 2010 Thanks for all the great info Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.