wright67uk Posted April 8, 2011 Share Posted April 8, 2011 Hello im receiving the error code, Parse error: syntax error, unexpected ';'on line 58 <?php mysql_connect("","business",""); mysql_select_db("business") or die("Unable to select database"); $result = mysql_query("SELECT subtype FROM business WHERE type ='restaurant' ORDER BY name"); $number_of_results = mysql_num_rows($result); $results_counter = 0; if ($number_of_results != 0) {while ($array = mysql_fetch_array($result) //THIS IS LINE 58 IN MY CODE $results_counter++; if ($results_counter >= $number_of_results); ?> Firstly do you know why I would get this error? and secondly how do i call my results. I basically want to return my results and then later on format them into lists. I would also like each result to have a different variable name. eg. result1 = $result1 result 2 = $result2 result3 = $result3 etc. any guidance much appreciated. Im a bit lost. Quote Link to comment https://forums.phpfreaks.com/topic/233047-calling-results-into-new-variables/ Share on other sites More sharing options...
ShoeLace1291 Posted April 8, 2011 Share Posted April 8, 2011 You don't need a semicolon ( after the variable definition in a while loop... or any type of loop unless there's another one following it. Edit: Dumb emoticons the smiley should be a ; lol Quote Link to comment https://forums.phpfreaks.com/topic/233047-calling-results-into-new-variables/#findComment-1198573 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.