snowdog Posted February 13, 2013 Share Posted February 13, 2013 I cannot see the error for the life of me. I know it is going to be a simple one. Always is when I cant see it. Here is the error Parse error: syntax error, unexpected $end in /var/www/vhosts/bookawrs.com/httpdocs/lot.php on line 138 and the code <? include("include/db_connect.php"); session_start(); include("header.php"); include("search.php"); include("top_menu.php"); include("left_menu.php"); ?> <div class="maincontent"> <div class="breadcrumbs"> <a href="dashboard.html">Dashboard</a> <span>Table Styling</span> </div><!-- breadcrumbs --> <div class="left"> <h1 class="pageTitle">Table Styling</h1> <? if($_SESSION['dealer_id'] != 0) { if(isset($_SESSION['dealer_id'])){ { echo(" I AM HERE IN DEALER SECTION"); $dealer_id = $_SESSION['dealer_id']; } } else { // This is an Franchise, get the list of dealers $franchise_id = $_SESSION['franchise_id']; $SQL = "SELECT * FROM dealers WHERE franchise_id = $franchise_id ORDER BY name ASC"; $result = mysql_query($SQL) or die(mysql_error()); ?> <select> <option>Select Dealer</option> <? while($run = mysql_fetch_array($result)) { ?> <option value = "<?php echo $run['id'];?>"><?php echo $run['name'];?></option> <? } ?> </select> <? } ?> <div class="sTableOptions"> <h4>Cars on Lot</h4> </div><!--sTableOptions--> <table cellpadding="0" cellspacing="0" class="sTableHead" width="100%"> <colgroup> <col class="head1" width="25%" /> <col class="head0" width="25%" /> <col class="head1" width="15%" /> <col class="head0" width="10%" /> <col class="head1" width="10%" /> <col class="head0" width="15%" /> </colgroup> <tr> <td>Vin Numner</td> <td>Year Model</td> <td>Left Front</td> <td>Right Front</td> <td>Left Rear</td> <td>Righ Rear</td> </tr> </table> <div class="sTableWrapper"> <table cellpadding="0" cellspacing="0" class="sTable" width="100%"> <colgroup> <col class="con1" width="25%" /> <col class="con0" width="25%" /> <col class="con1" width="15%" /> <col class="con0" width="10%" /> <col class="con1" width="10%" /> <col class="con0" width="15%" /> </colgroup> <? // Get the cars that are on the lot from the dealer being called $SQL = "SELECT * FROM lot WHERE franchise_id = $franchise_id and dealer_id = $dealer_id ORDER BY date ASC"; $result = mysql_query($SQL) or die(mysql_error()); while($run = mysql_fetch_array($result)) { ?> <tr><td><?php echo $run['vinNumber'];?></td><td><?php echo $run['carYear'];?> $nbsp;<?php echo $run['carModel'];?></td><td><img src="">pic 1</td><td><img src="">pic 2</td><td><img src="">pic 3</td><td><img src="">pic 4</td></tr> <? } ?> </table> </div><!--sTableWrapper--> <br /> </div><!--left--> <br clear="all" /> </div><!--maincontent--> <? include("footer.php"); ?> Link to comment https://forums.phpfreaks.com/topic/274423-cant-see-the-error/ Share on other sites More sharing options...
Barand Posted February 13, 2013 Share Posted February 13, 2013 That error usually indicates that somewhere you have an opening { without a corresponding closing } Link to comment https://forums.phpfreaks.com/topic/274423-cant-see-the-error/#findComment-1412129 Share on other sites More sharing options...
scootstah Posted February 13, 2013 Share Posted February 13, 2013 You have two opening brackets for this if(): if(isset($_SESSION['dealer_id'])){ { This would have been easily spotted with a decent text editor with syntax/bracket highlighting. Link to comment https://forums.phpfreaks.com/topic/274423-cant-see-the-error/#findComment-1412130 Share on other sites More sharing options...
snowdog Posted February 13, 2013 Author Share Posted February 13, 2013 Thanks scootstah, do you have any suggestions for a good one? I use cute ftp as I can edit and upload in the same program. Link to comment https://forums.phpfreaks.com/topic/274423-cant-see-the-error/#findComment-1412138 Share on other sites More sharing options...
scootstah Posted February 13, 2013 Share Posted February 13, 2013 You use an FTP application as a text editor? Huh? I use PHPStorm for projects and Sublime Text 2 for small stuff or quick edits. Neither are free, both are well worth the money. If you want free, Eclipse with PHP Developer Tools is a good IDE, and Notepad++ (on Windows) is a decent text editor. If you're on a Mac or Linux you could try Emacs. EDIT: By the way, most decent text editors have built in FTP support. But, working directly on the live server like that is not the best of ideas. Link to comment https://forums.phpfreaks.com/topic/274423-cant-see-the-error/#findComment-1412141 Share on other sites More sharing options...
snowdog Posted February 13, 2013 Author Share Posted February 13, 2013 I don't mind paying if it is good. I see it has a 30 day trial, will give it a shot thanks. I am self taught and need to update my coding skills now with the new release of php for sure. Thanks for all of your help. I will be posting another problem I am having as I cannot find the proper way to do this so check it out Link to comment https://forums.phpfreaks.com/topic/274423-cant-see-the-error/#findComment-1412142 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.