-3
$sql_new=$sql1. UNION .$sql2;

This expression gives the following error notice:

Use of undefined constant UNION - assumed 'UNION' in php

halfer
  • 19,471
  • 17
  • 87
  • 173
  • Can we get some more delete votes on this question please? It is good it was solved, but I don't think it has any long-term value for future readers. – halfer Jan 07 '18 at 14:18

1 Answers1

0
$sql_new=$sql1 . " UNION " . $sql2;

you have to put your strings into quotes so that PHP knows it's a string.

Franz Gleichmann
  • 3,211
  • 4
  • 21
  • 29