0

I am trying to use the late static binding concept during insertion but I am getting a syntax error when I am writing this statement: I am using php version 5.3.8

$resultArray = $this->connection->query("insert into " static::$table "(title,link) values('hi','hello')");
imrahul
  • 41
  • 6

1 Answers1

1

Looks like you forgot some dots to concatenate static::$table with the rest of the query string. Try this:

$resultArray = $this->connection->query("insert into " . static::$table . "(title,link) values('hi','hello')");
Bas Peeters
  • 3,269
  • 4
  • 33
  • 49
  • no i didn't forget that i tried to use (.) operator but still it is not working – imrahul Feb 11 '15 at 13:07
  • I am using Dreamweaver CS5 as editor and in that if i am writing this code ,i m facing syntax error indication.....i hope its editor version issue – imrahul Feb 14 '15 at 09:49