This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I am trying to get data from a querystring that looks like this:
http://127.0.0.1:8000/product/controller/php?ids[]=[product_code]1INSAZE
if I do :
$ids = $request->query->get('ids', null);
and dump it I get something like this :
array:1 [â–¼ 0 => "[product_code]1INSAZE" ] ]
if I dump($ids[0]) I get:
"[product_code]1INSAZE"
i Need that string in order to do this:
$ids = $ids[0];
$result = $this->createQueryBuilder('k')
->andWhere("k.product_code = $ids")
->getQuery()
->getResult();
return $result;
I get this error :
[Syntax Error] line 0, col 72: Error: Expected Literal, got '['
is it related to that [product_code]? and If yes how do I get rid of that and execute the query?
thanks for your help!!!
Post Details
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/PHPhelp/com...