-1

I have error on this line:

$previous_next = '<div class="previous">POPRZEDNI WPIS:<h4><a href="#">'.<?= $previous_row->title ?>.'</a></h4><br></div>';

The error is

An uncaught Exception was encountered

Type: ParseError

Message: syntax error, unexpected '<'

Filename: E:\XAMPP\htdocs\projekt2\application\models\Devloger.php

Line Number: 68

Backtrace:

File: E:\XAMPP\htdocs\projekt2\application\controllers\Main.php
Line: 9
Function: model

File: E:\XAMPP\htdocs\projekt2\index.php
Line: 315
Function: require_once

Sublime Text even doesn't highlight this code properly. But I can't see anything wrong in here. What is wrong here?

Adrianno Barello
  • 127
  • 1
  • 12
  • `= $previous_row->title ?>` should be `$previous_row->title` You have not use `` inside php-code – splash58 May 31 '17 at 09:39
  • To add to the comment above; The error is being thrown because you are already inside of the php tags, there's no need to add another set of `= ?>` when you're already inside a pair. – Epodax May 31 '17 at 09:40
  • just remove the PHP tags – Toxide82 May 31 '17 at 09:41

1 Answers1

2

Try this

$previous_next = '<div class="previous">POPRZEDNI WPIS:<h4><a href="#">'.$previous_row->title.'</a></h4><br></div>';
Pramod Patil
  • 2,704
  • 2
  • 14
  • 20