fehrenbacher33 Posted October 8, 2009 Share Posted October 8, 2009 My error is Parse error: parse error, expecting `','' or `';'' in F:\IST405\Exercises\xampp-win32-1.7.1(3)\xampp\htdocs\IST405\ex07\selectStudent.php on line 46 I cant figure it out whats wrong heres my code please help. <?php $server = "localhost"; // Server name $user = "root"; // User name $pwd = ""; // Password /********************************************* Connect to Database and Failed Message ************************************************/ $connect = mysql_connect ($server, $user, $pwd) or die ("ERROR: Connection failed!"); /************************************************ *************************************************/ $select = mysql_select_db("school"); if(!$select) exit("Error: Could not select database!"); $sql = "SELECT * FROM Student"; $query = mysql_query($sql); if (mysql_num_rows($query) == 0) { echo "No records found"; } else { echo "<table align=center border = 1>"; echo"<tr>"; echo "<td><b>StudentID</td>"; echo "<td><b>FirstName</td>"; echo "<td><b>LastName</td>"; echo "<td><b>Email</td>"; echo "<td><b>Gender</td>"; echo "<td><b>Password</td>"; echo "<td><b>ConfirmPassword<td>"; echo "<td><b>StudentYear<b></td>"; echo "<td><b>Interest</td>"; echo "<td><b>Profile</td>"; echo "<td><b>Picture</td>"; echo "<td><b>Sports</td>"; echo"</tr>"; while($row = mysql_fetch_object($query)) { echo"<tr>"; echo "<td>".$row->StudentID"</td>"; echo "<td>".$row->FirstName"</td>"; echo "<td>".$row->LastName"</td>"; echo "<td>".$row->Email"</td>"; echo "<td>".$row->Gender"</td>"; echo "<td>".$row->Password"</td>"; echo "<td>".$row->ConfirmPassword"<td>"; echo "<td>".$row->StudentYear"</td>"; echo "<td>".$row->Interest"</td>"; echo "<td>".$row->Profile"</td>"; echo "<td>".$row->Picture"</td>"; echo "<td>".$row->Sports"</td>"; } echo"</tr>"; } echo"</table>"; mysql_close($connect); ?> Link to comment https://forums.phpfreaks.com/topic/176916-need-help-parse-error-parse-error-expecting-or/ Share on other sites More sharing options...
fooDigi Posted October 8, 2009 Share Posted October 8, 2009 after $row->StudentID on line 46 ... and the following lines, you need a '.' to concatenate the string properly Link to comment https://forums.phpfreaks.com/topic/176916-need-help-parse-error-parse-error-expecting-or/#findComment-932803 Share on other sites More sharing options...
fehrenbacher33 Posted October 8, 2009 Author Share Posted October 8, 2009 thanks a lot that worked Link to comment https://forums.phpfreaks.com/topic/176916-need-help-parse-error-parse-error-expecting-or/#findComment-932806 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.