crose1211 Posted February 3, 2011 Share Posted February 3, 2011 I am currently writing a code for class where I have to get my php script to run a query through mysql database to retrieve the information that was built in the table I created. I keep getting a parse error on line 44 message; when there is nothing on line 44, when I change the code in the script to run, whatever I do to this I keep getting the same error. "Parse Error on Line 44". I have rebuilt this code over and over and over. I am also trying to use an html form to submit a query that will execute the query to search through the database with the SELECT statement but I cannot see if anything works because I cannot get past the parse error on line 44 message. Please help if you can, I am bummed out here. The tutoring center is down today because of all the snow they got and my Professor still hasn't gotten back in touch with me. This is just the simple code for the form, I haven't modified it into a drop down menu yet to run a query from a selected state because I still don't have the query running right. <html xmlns="http://www.w3.org/1999/xhtml"> <head></head> <body> Submit a Request for Information <form action = "miller.php" method = "get"> <table align='Left'> <tr> <td>Sort by State:</td> <td><input name='State' /></td> </tr> </table> <input type = 'submit'/> </form> <a href="http://localhost/millerUnit7index.html</a> </body> </html> this is the code for the contact table: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head></head> <body> <?php $ContactArray = file("contacts.txt"); sort($ContactArray); echo "<table border='5' width ='300'>"; foreach($ContactArray as $record){ $recordItems = explode (",",$record); echo "<tr>"; echo "<td> $recordItems[0], $recordItems[1]</td>"; echo "<td> $recordItems[6], $recordItems[7] </td>"; echo "</tr>"; }//end foreach echo "</table>"; ?> </body> </html> and this is the code for the query I am trying to execute through mysql, this is the one that is giving me the parsing error <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head></head> <body> <?php $DBConnect = mysqli_connect("localhost","user1", "password1","miller"); $query = mysqli_query("SELECT lName,fName,number FROM contactform ORDER BY state ASC"); $result = mysqli_query($DBConnect,$query); $row = mysqli_fetch_row($results); echo "<table width='100' border = '5'>\n"; echo "<tr>"; echo "<th> Last Name</th>"; echo "<th> First Name</th>"; echo "<th> Phone Number</th>"; echo "</tr>\n"; while (($row = mysqli_fetch_row($results)) !==FALSE){ echo "<tr>"; echo "<td> $row[0]</td>"; echo "<td> $row[1]</td>"; echo "<td> $row[6], $row[7]</td>"; echo "</tr>\n"; }; echo "</table>\n"; mysqli_close($DBConnect); ?> <a href="http://localhost/millerUnit7/millerQuery.php</a> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/226577-parse-error-on-line-44/ Share on other sites More sharing options...
BlueSkyIS Posted February 3, 2011 Share Posted February 3, 2011 is "Parse Error on Line 44" the entire message??? Quote Link to comment https://forums.phpfreaks.com/topic/226577-parse-error-on-line-44/#findComment-1169470 Share on other sites More sharing options...
BlueSkyIS Posted February 3, 2011 Share Posted February 3, 2011 fwiw: neither of those PHP code snippets give me a parse error. Quote Link to comment https://forums.phpfreaks.com/topic/226577-parse-error-on-line-44/#findComment-1169472 Share on other sites More sharing options...
PFMaBiSmAd Posted February 3, 2011 Share Posted February 3, 2011 There's not even 44 lines in any of the posted files. Quote Link to comment https://forums.phpfreaks.com/topic/226577-parse-error-on-line-44/#findComment-1169483 Share on other sites More sharing options...
Maq Posted February 3, 2011 Share Posted February 3, 2011 I keep getting a parse error on line 44 message; when there is nothing on line 44 Error message usually don't lie, well, at least not about line numbers Quote Link to comment https://forums.phpfreaks.com/topic/226577-parse-error-on-line-44/#findComment-1169490 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.