Jump to content

calling results into new variables


wright67uk

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/233047-calling-results-into-new-variables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.