-2

*i have written insert code in doctrine like this $social = new Entities\SocialKeyword;

        $social->setEventId($_GET["eventId"]);
        $social->setHashtag($_GET["hashtag"]);

        $this->em->persist($social);
        $this->em->flush();

now i want to merge $_GET["eventId"] and $_GET(hashtag) and both are septated by '-' and insert it into prime colum in table.

i written it like this but its not working.

$social->setPrime(CONCAT($_GET["eventId"],'-', $_GET["hashtag"]));

need help.

Sunil Chhimpa
  • 404
  • 1
  • 4
  • 12
  • 1
    This question appears to be off-topic because OP does not have a minimal understanding of the used laguage, and obviously did not search the web. – NDM Sep 03 '14 at 11:45

2 Answers2

4

In PHP concatenation operator is ('.') but you used (','). Try with this:

$concate_value = $_GET["eventId"].'-'.$_GET["hashtag"];
$social->setPrime($concate_value);
hizbul25
  • 3,829
  • 4
  • 26
  • 39
0

First $_GET(hashtag) is looking wrong it should $_GET["hashtag"]. Simple use dot (.) operator for string concatenation

$_GET["eventId"] . '-' . $_GET["hashtag"]

In your code

$social->setPrime($_GET["eventId"] . '-' . $_GET["hashtag"]);
Girish
  • 11,907
  • 3
  • 34
  • 51