Jump to content

Parse error


jdimino

Recommended Posts

Hi Everyone

I'm getting a parse error, can someone help?

 

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home1/internb7/public_html/SEindex2.php on line 34

 

 

<?php

$breakstring='';

$link = mysql_connect('localhost', 'xxxx_jxxxx', 'jxxxx');
if (!$link) {   die('Could not connect: ' . mysql_error()); }
mysql_select_db('xxxxx');

// Fetch total number of records
$result = mysql_query("SELECT COUNT(*) AS recordCount FROM ihsreg");
$row = mysql_fetch_assoc($result);
$recordCount = $row['recordCount'];


// Perform Search
$results = array();
if(isset($_REQUEST['search'])){
    
    $limit = 20;
    if($_GET['offset']){ $offset = $_GET['offset']; } else { $offset = 0; }

    $SQL = "SELECT * FROM ihsreg ";

    //$term = strtoupper(addslashes($_REQUEST['search']));
    $term = strtoupper($_REQUEST['search']);
    if(stristr($term,"'") && !stristr($term,"\'")){
        $term = addslashes($term);
    }

    if($_REQUEST['radiobutton']){
        $fields=array(1 => "Bloom_Name", 2 => "Pod_Name", 3 => "Pollen_Name", 4 => "Hybridiser", 5 => "Origin", 6 => "Grower", 7 => "Color_Group", 8 => "Bloom_Type", 9 => "Reg_Mini", 10 =>  "Size_Range", 11 => "Propagation", 12 => "Bloom_Color", 13 => "Bloom_Characteristics", 14 => "Leaf_Characteristics", 15 => "Bush_Characteristics", 16 => "Cross_Made", 24 => "date", 25 => "Bloom_Name");

        $SQL.=" WHERE \"$fields[(int)$_REQUEST['radiobutton']]\" LIKE \"$term\""; break;
    } else 
    {
        // If they didnt' select a radio button... 
        $SQL.=" WHERE Bloom_Name LIKE \"$term\"";
    }

    $result = mysql_query($SQL);
    $resultCount = mysql_num_rows($result);
    
    $SQL.= " LIMIT $offset, $limit";

    $result = mysql_query($SQL);
    
    if($resultCount > 0){
        while($row = mysql_fetch_assoc($result)){
            // What does the line below do
              // $results[$row['id']] = $row;

                if($row['approve'] == false) {$breakstring='Registration Pending';break;}
        } // while
    }
else
{
     $breakstring='The Name not Registered you may use this name to Register a new Cultivar';
} // if there are results
} // if user performed a search

if(!empty($breakstring))
{
     echo $breakstring;
// do what ever
}
else
{
// do whatever else
}

?> 

Link to comment
https://forums.phpfreaks.com/topic/152450-parse-error/
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.