PHP syntax error

I wonder why this bit of code

Return $this-> results() [0]

is considered a syntax error in dreamweaver when it works fine?

Because it is the reference to which is new to PHP 5.4 using table and I don't think DW is informed on this subject.

Tags: Dreamweaver

Similar Questions

  • Dreamweaver CS5 shows a PHP syntax error

    I just started with CS5 because I was hard to navigate with CS3 after for so long.

    CS5 tells me that I have a syntax error that relates to the last line;

    < / body >
    < / html >
    <? PHP mysql_free_result ($WADAreferences);? >

    But I don't see why.

    Any ideas?

    If you get an error of syntax on the last line of PHP, this means that you have a missing closing brace for a block of code somewhere balance braces allows to check the matching opening and closing braces.

  • Need help with PHP syntax error

    I fight with this error message ""Parse error: syntax error, unexpected T_IF ' for the 66 line that I get. " Here is the code that I use that I got with the help of the users of this site, which is supposed to launch a search for multiple parameters on a mysql database. The red text is the line 66. I just starting to learn PHP and I can not know what to do with it. Is it possible to have two if statements following each other like this? In addition, as I said, I was given this code from the help of this forum, but I don't understand what the purpose is of the $where variable. This code will work also without it? Thanks in advance for any help.

    $query_rsMainItems = ' SELECT * FROM mainitems; $where = false; If (isset($_GET['category']) & &! empty($_GET['category'])) {$. query_rsMainItems = 'category WHERE ='.} GetSQLValueString ($_GET ['category'], 'text');      $where = true; } If (isset($_GET['price']) & &! empty($_GET['price'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. = 'price ='. GetSQLValueString ($_GET ['price'], 'text'); } If (isset($_GET['time1']) & &! empty($_GET['time1'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. = '(EDT) 1 ='. GetSQLValueString ($_GET ['time 1'], 'text'); } If (isset($_GET['time2']) & &! empty($_GET['time2'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. is 'time2 ='. GetSQLValueString ($_GET ['time2'], 'text'); } If (isset($_GET['city']) & &! empty($_GET['city'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. = 'city ='. GetSQLValueString ($_GET ['city'], 'text'); } If (isset($_GET['zip']) & &! empty($_GET['zip'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}     $where = true;   } $query_rsMainItems. = 'zip ='. GetSQLValueString ($_GET ['zip'], 'text'); } If (isset($_GET['neighborhood']) & &! empty($_GET['neighborhood'])) {if ($where) {$query_rsMainItems. = 'AND';}}   } else {$. query_rsMainItems = "WHERE";}   } $query_rsMainItems. = 'quarter ='. GetSQLValueString ($_GET ['suburb'], 'text');

    I copied and pasted the code in a local page. Aside from a missing brace after the last line ($query_rsMainItems. = 'quarter ='.) GetSQLValueString($_GET['neighborhood'], 'text');), it works perfectly.

    The error message is a unexpected T_IF in line 66. This means that the PHP engine is not expected a conditional clause at this time here. In all likelihood, there is an error at an early stage in the code, which resulted in an unmatched brace.

    The code I provided works. I tested completely before posting originally and tested again. The problem is that I tested it in isolation from the rest of the code in your page. Without seeing the whole page, it is impossible to determine where the error is located.

  • PHP form syntax error

    Parse error : syntax error, unexpected '. ' in /Home/micha170/public_html/OnlineApproval.php online 101

    It seems that I am stuck again.

    Here's the line 101 of my code. Can someone tell me where is the error?

    If (! $errName & &! $errEmail & &! $errPhone & &! $errBusiness & &! $errRestaurant & &! $errDate & &! $errPhotoChoice & &! $errApproval & &! $errComments & &! $errSubmittedBy! $errHuman) {}

    Your lack of logic Operteur - & see highlighted in red below:

    If (! $errName &! $errEmail &! $errPhone &! $errBusiness &! $errRestaurant &! $errDate &! $errPhotoChoice &! $errApproval &! $errComments &! $errSubmittedBy and ! $errHuman) {}

  • Help PHP - Parse error: syntax error, unexpected T_VARIABLE the meantime

    Hello

    Just wiondered if anyone can help, I edited the files as requested:-

    // 1. Enter the name of your slideshow
    $slideshow = "HolyportFC".

    // 2. Enter the URL of your site (no trailing slash)
    $siteURL = " " http://www.thevillagers.co.UK "

    // 3. Enter the absolute path of your site on the server (without slash)
    $sitePath = ' home/thevilla/public_html ".

    Include the slideshow
    include_once ($sitePath. ("" / fpss/fpss.php "); DO NOT CHANGE THIS LINE

    But on the PHP example display, I get: -.


    Parse error: syntax error, unexpected T_VARIABLE the meantime in /home/thevilla/public_html/example.php on line 43

    Wondering if anyone could tell me my mistake?

    Thank you

    Richard

    I'm not a mind reader: do not know what you are referring to measures or what your code is, especially to line 43 where the error message occurs. It is helpful if you describe exactly what you're doing and your code. Put a semicolon after each line that declares a variable where the unexpected error message variable

    for example:

    $slideshow = "HolyportFC";

  • PHP/MySQL Parse error: syntax error, unexpected T_VARIABLE the meantime

    I am new to web programming and I'm testing my first PHP/MySQL of HTML data request.

    Already, I get the following error in the analysis:

    Parse error: syntax error, unexpected waiting T_VARIABLE... on line 7.

    Simple code is:

    <? PHP

    $pwd = $_POST ["password"];
    $dbn = $_POST ['database_name'];
    $hnm = $_POST ["hostname"];

    $link_id = mysql_connect ($hnm, $dbn, $pwd);       This is line 7 where I get the error message
    If (isset ($link_id))
    {
    $result = mysql_list_dbs ($link_id);
    echo $result;
    mysql_select_db("hppumps",$link_id);
    $result = mysql_list_tables("hppumps",$link_id);
    echo $result;
    $result = mysql_list_fields ("hppumps", "models");
    echo $result;
    $rows = mysql_affected_rows ($result);
    If ($rows < 1) {echo "error.  Registration has not been added to the database. « ;}
    else {echo "$rows response (s) has been added to the database." ;}}
    }
    on the other
    {
    echo "error.  You were unable to connect to the MySql database";
    }
    ? >

    ANY HELP WITH THIS WOULD BE GREATLY APPRECIATED!

    marcusinfla wrote:

    If it is an exact copy of your code, the problem here and not on the 7 line.

    Do not space between the question mark and the php. The opening PHP tag should look like this:

    		   
  • Parse error: syntax error, unexpected T_STRING, expecting ', ' or ';' - HELP PLEASE

    On a file for a deletion of records in MYSQL, I have a problem with the code, all other features works great execpt the record removal tool

    The problem is on line 96;

    <td><a href="deleterecprd.php?recordID=<?php echo  $row_ recordsetName [' fieldName ']; ?>"><?php echo $row_Recordset1['Date']; ?></a></td>
    

    The problem is;

    Parse error: syntax error, unexpected T_STRING, expecting ', ' or ';'

    I am running PHP 5.2 / MYSQL 5.1.57

    Thank you

    You have an involuntary space where I put a X:

    $row_XrecordsetName

  • MySQL stored procedure syntax errors

    I have a request online, I want to use transactions either commit all updates of db or anything. The code I created is as follows, not only am I getting an error of syntax on lines 5 and 16, but frankly I do not know that the code is really going to do what I want. Please let me know if you see syntax errors and explain them.

    CREATE PROCEDURE increase_maint_priority
        (maint_item INT, new_priority INT, cur_priority INT, center_id INT)
     
    BEGIN
        START TRANSACTION; -- line 5 syntax error
        -- start updates
        UPDATE maintitem SET priority = (priority+1) 
            WHERE priority > cur_priority
            AND priority <= new_priority
            AND centerID = center_id;
            
        UPDATE maintitem SET priority = new_priority
            WHERE id = maint_item;
        
        COMMIT;
    END; -- line 16 syntax error
    

    Thank you in advance for helping a newb to stored procedures.

    If you want to help me to know if this code will actually work for what I want, that the following describes the situation.

    Main idea: business location apply for maintenance at their Center. Applications can be added anywhere in the list of priority (1 = highest priority). They can also change the priority of an application at any time.

    Previously I was using php to control a loop of update mysql queries (ouch, I know now, 2 sql statements could do the trick) and we live lately priorities in double, and other problems which seem to be very likely related to the update of the priorities of several elements.

    Ex: moving priority 6 to priority 1 requires 1 update query because the current priority of the 6th point, but a second query (or loop of several others since I am very new to the drafting 2 years ago sql statements) to update the other priorities.

    Thus, the desire for transaction method.

    Once again, thanks in advance for any help on this matter.

    PS - I use MySQL workbench to write this and it's where to find errors.

    I do not use MySQL and its syntax is slightly different from the other DBMS stored procedures. In all cases, once you eliminate the warning, you also add a handler to ensure that updates roll back in case of error:

    http://khanrahim.WordPress.com/2010/05/16/transaction-with-stored-procedure-in-MySQL-serve r.

  • Beginner: Get on the WHERE clause syntax error in SELECT

    I am very new to php and mySQL.  Use DW master/detail to generate Basic code I need.  One thing I have to do is to modify a select statement in the master to include a WHERE clause to limit the selection to a particular value in a field.

    I get a syntax error with the select statement in the WHERE clause, I add to the map.

    It's the part of the error message showing the location of the error:

    "WHERE group = 'Community' LIMIT 0, 10'"

    Php that generated the select is:

    $query_maps = "SELECT * FROM tblmaps ORDER BY tblmaps.» DispSeq ';

    $query_limit_maps = sprintf ("%s WHERE group =' LIMIT %s %d, %d", $query_maps, $selectGroup, $startRow_maps, $maxRows_maps);

    This approach to create the select statement is on the generated code for the master page.  He added the LIMIT clause.  I didn't add the ' WHERE group = '%s' and the variable $selectGroup, which comes from the old code.»  You can see that the $selectGroup variable is equal to the "community: group.»

    I scanned the web to see what syntax error, I could do, but haven't found anything that explains it.

    The resolved full select statement is:

    SELECT * FROM tblmaps ORDER BY tblmaps. WHERE DispSeq = 'Community' LIMIT 0,10 group

    What I don't see?

    Tom

    The group is a reserved word in MySQL. You could probably put single quotes around it, but I suggest to rename this column. Do not use reserved words for column names.

  • Syntax error using

    I use php and mysql for this application.

    <?php
    include_once('config.php');
    
    $user = $_POST['username'];
    $pass = md5($_POST['password']);
    
    $connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());
    $db = @mysql_select_db($db_name,$connection)or die(mysql_error());
    $sql = "SELECT usr_id FROM $tb_users WHERE usr_username = '$user' and usr_password = '$pass'"; //line 12
    $result = @mysql_query($sql,$connection) or die(mysql_error());
    $num_rows = mysql_num_rows($result);
    ?>
    
    

    I get the following error:

    Parse error : syntax error, unexpected '=' in /home/admin/public_html/Smet/scripts/config.php online 12

    I can't locate the question where this problem occurs, any help would be appreciated.

    p.s. I've just included the portion of code that is carried out when my script and marked line 12 as a comment.

    ~ justin

    He tells you that the error is in config.php. You should post the content of this script instead.

  • Parse error: syntax error, unexpected $end

    I have the following code in a file to reformat the date.

    <?php do { 
    $timeDate = $row_rsIndex['timeDate'];
    $date = date("M j, Y",strtotime("$timeDate"));
    ?>
    

    When I use this code in another file to reformat the date, I get this error. "Parse error: syntax error, unexpected $end in /home/content/e/v/e/everfoundmusic/html/test/tour_main.php on line 148"

    Is that what the problem of ideas? I tried Googling it but has not found an answer.

    Here is the php.

    <?php require_once('Connections/everfoundapp.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    mysql_select_db($database_everfoundapp, $everfoundapp);
    $query_rsIndex = "SELECT * FROM tour WHERE timeDate >= CURDATE() ORDER BY timeDate DESC";
    $rsIndex = mysql_query($query_rsIndex, $everfoundapp) or die(mysql_error());
    $row_rsIndex = mysql_fetch_assoc($rsIndex);
    $totalRows_rsIndex = mysql_num_rows($rsIndex);
    
    $colname_rsDetails = "-1";
    if (isset($_GET['id'])) {
      $colname_rsDetails = $_GET['id'];
    }
    mysql_select_db($database_everfoundapp, $everfoundapp);
    $query_rsDetails = sprintf("SELECT * FROM tour WHERE id = %s", GetSQLValueString($colname_rsDetails, "int"));
    $rsDetails = mysql_query($query_rsDetails, $everfoundapp) or die(mysql_error());
    $row_rsDetails = mysql_fetch_assoc($rsDetails);
    $totalRows_rsDetails = mysql_num_rows($rsDetails);
    ?>
    
    
    <?php do { 
    $timeDate = $row_rsIndex['timeDate'];
    $date = date("M j, Y",strtotime("$timeDate"));
    ?>
              
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Tour Schedule</title>
    <link href="style_tour_main.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    <?php
    // Show IF id not sent
    if (@$_GET['id'] == "") {
    ?>
    
    <table width="608" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <th width="60" align="left" valign="top" scope="row"><strong>Date</strong></th>
        <td width="150" align="left" valign="top"><strong>City | State</strong></td>
        <td width="247" height="30" align="left" valign="top"><strong>Venue</strong></td>
        <td width="161" align="left" valign="top"><strong>Info</strong></td>
      </tr>
    </table>
    <!-- START index -->
        
         <table width="608" border="0" cellpadding="0" cellspacing="0">
             
          <?php do { ?>
          <tr>
                <td width="60" height="19" align="left" valign="top"><a href="tour_main.php?id=<?php echo $row_rsIndex['id']; ?>"><?php echo $row_rsIndex['timeDate']; ?><br />
                </a></td>
    <td width="150" align="left" valign="top"><a href="tour.php?id=<?php echo $row_rsIndex['id']; ?>"> </a><a href="tour_main.php?id=<?php echo $row_rsIndex['id']; ?>"><?php echo $row_rsIndex['addrCity']; ?>, </a><a href="tour_main.php?id=<?php echo $row_rsIndex['id']; ?>"><?php echo $row_rsIndex['addrState']; ?></a></td>
            <td width="247" align="left" valign="top"><a href="tour_main.php?id=<?php echo $row_rsIndex['id']; ?>"><?php echo $row_rsIndex['venue']; ?></a></td>
            <td width="161" align="left" valign="top"><a href="tour_main.php?id=<?php echo $row_rsIndex['id']; ?>"><em>MORE INFO</em></a></td>
          </tr>
          <tr>
            <td colspan="4" align="left" valign="top" class="space">  </td>
          </tr>
          <?php } while ($row_rsIndex = mysql_fetch_assoc($rsIndex)); ?>
    </table>
    <!-- END index -->
    
    
    <!-- START details -->
    <? } else { ?>
    
    
    <h6><a href="tour_main.php">&laquo; Back to Tour Schedule</a></h6>
    <h1><?php echo $row_rsDetails['timeDate']; ?> - <?php echo $row_rsDetails['addrCity']; ?>, <?php echo $row_rsDetails['addrState']; ?></h1>
    
    <table cellspacing="4">
      <tr>
             <td width="61"><b>Time:</b></td>
            <td width="207" class="dtext"><?php echo $row_rsDetails['timeTime']; ?></td>
        </tr>
        
        <tr>
             <td><b>Venue:</b></td>
            <td class="dtext"><?php echo $row_rsDetails['venue']; ?></td>
        </tr>
        
        <tr>
             <td valign="top"><b>Location:</b></td>
            <td class="dtext"><?php echo $row_rsDetails['addrAddress']; ?><br />
                   <?php echo $row_rsDetails['addrCity']; ?>, <?php echo $row_rsDetails['addrState']; ?> <?php echo $row_rsDetails['addrZip']; ?><br />
           <?php echo $row_rsDetails['addrCountry']; ?></td>
        </tr>
        
        <tr>
             <td><b>Cost:</b></td>
            <td class="dtext">$<?php echo $row_rsDetails['cost']; ?></td>
        </tr>
        
        <tr>
             <td valign="top"><b>Details:</b></td>
            <td class="dtext"><?php echo $row_rsDetails['description']; ?></td>
        </tr>
    </table>
    
    
    <?php }
    // endif id is sent
    ?>
    <!-- END details -->
    </body>
    </html>
    <?php
    mysql_free_result($rsIndex);
    
    mysql_free_result($rsDetails);
    ?>
    

    Hello.. You should change it

    
    
         

    for this

    
    
         
    ">
    $timeDate = $row_rsIndex['timeDate']; $date = date("M j, Y",strtotime("$timeDate")); ?>
  • PHP Parse Error

    I'm new to PHP in Dreamweaver somehwat but understand it well enough to be totally confused as to why I get the following error when the page is loaded:

    Parse error: syntax error, unexpected ' {'}

    Help!

    Thank you, David. Who did the trick. Cut and paste the code that has errors in it... Beginner indeed.

    Just finished your book last week, was an excellent introduction to PHP & DW8, really useful.

    See you soon.

  • Syntax error? : = SUMIF(C2:C94,"=10",H2:H94)

    I changed this equation in several different ways and may not have to work. I started by copying directly from a spreadsheet where he worked. Now that I have it on the worksheet on that I need I get syntax errors. I deleted and retyped thinking it was a problem of copy / paste, nothing works. I don't know what I'm doing wrong. This formula has always worked for me. Help, please.

    Hi katxoxo,

    In short, it seems ok to me.

    You could try to do is recreate the formula by clicking and pointing and build these terms by in the Inspector of the formula.

    Quinn

  • Why my emails sent to customers yahoo and mindspring rejected for syntax errors?

    Here is the error message:

    Delivery to the following recipient failed permanently:

        Lisa@[email protected]
    

    Technical details of permanent failure:
    Google has tried to convey your message, but it was rejected by the server for domain yahoo.com by mta7.am0.yahoodns.netrecipient. [98.138.112.37].

    The error that the other server returned was:
    501 Syntax error in parameters or arguments

    Having two ' @' characters seems quite problematic.

    What version of Thunderbird do you use? I read a different view today where there was apparently stray characters being added to the email address.

    Can you identify which parts of the address are correct, and the bits seem to have been added?

  • Since the patch v17, I get syntax errors on each site, that I will. 2 windows each time. OK twice and they are gone.

    It's the 1st small window that displays ' evalInSandbox:SyntaxError: syntax error ".
    I click 'OK', then the following window appears "syntax error". I click 'ok' and it disappears until I go to another web page.

    I had the same exact errors to appear on all Web sites. I tested each extension and add on to my firefox and found that it was the application of SocialFixer (version 7.2) that was the problem. If you have installed, try to update to version 7.3 of SF. It fixed my problem, maybe he'll deal with yours!

  • Maybe you are looking for

    ">$date; ?>