genzedu777 Posted November 7, 2010 Share Posted November 7, 2010 Hi guys, I have an error msg here, "Warning: mysqli_error() expects exactly 1 parameter, 0 given in D:\inetpub\vhosts\championtutor.com\httpdocs\tutor_registration3.php on line 598". I have highlighted the error line in red, do you guys have any idea what went wrong? Thanks <?php $dbc = mysqli_connect('localhost', '111', '111', '111') or die(mysqli_error()); $query = "SELECT sl.subject_level_id, sl.level_id, sl.subject_id, tl.name AS level_name, ts.name AS subject_name " . "FROM tutor_subject_level AS sl " . "INNER JOIN tutor_level AS tl USING (level_id) " . "INNER JOIN tutor_subject AS ts USING (subject_id) "; $sql = mysqli_query($dbc, $query) or die(mysqli_error()); echo'<table><tr>'; // Start your table outside the loop... and your first row $count = 0; // Start your counter while($data = mysqli_fetch_array($sql)) { /* Check to see whether or not this is a *new* row If it is, then end the previous and start the next and restart the counter. */ if ($count % 5 == 0) { echo "</tr><tr>"; $count = 0; } echo '<td><input name="subject_level[]" type="checkbox" id="'.$data['subject_level_id'].'" value="'.$data['subject_level_id'].'"/>'; echo '<label for="'.$data['subject_name'].'">'.$data['subject_name'].'</label></td>'; $count++; //Increment the count } echo '</tr></table><br/><br/>'; //Close your last row and your table, outside the loop ?> Link to comment https://forums.phpfreaks.com/topic/218006-warning-mysqli_error-expects-exactly-1-parameter-0-given-in/ Share on other sites More sharing options...
PFMaBiSmAd Posted November 7, 2010 Share Posted November 7, 2010 I recommend you read the php.net documentation for mysqli_error(), it requires the mysqli link as a parameter. Link to comment https://forums.phpfreaks.com/topic/218006-warning-mysqli_error-expects-exactly-1-parameter-0-given-in/#findComment-1131413 Share on other sites More sharing options...
genzedu777 Posted November 8, 2010 Author Share Posted November 8, 2010 Hi PFMaBiSmAd, Thanks for the info, I've read it, but I still don't quite understand what they mean, just to check with you, does php has any software to debug? Thanks, Wilson Link to comment https://forums.phpfreaks.com/topic/218006-warning-mysqli_error-expects-exactly-1-parameter-0-given-in/#findComment-1131596 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.