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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.