title: How to use ST_GeomFromText('Point($1 $2)', 4326) inside pg_query_params call
body: <p>I am new to postgresql/postgis and would like to insert a geometry point type into my database with a pg_query_param call. I tried the following:</p>
  
  <pre><code>$query = "INSERT INTO userloc (email, latitude, longitude, the_geom) VALUES($1, $2, $3, ST_GeomFromText('POINT($3 $2)', 4326))";
  $rs = pg_query_params($con, $query, array('%$#^@@gmail.com', 0, 0));
  </code></pre>
  
  <p>but this yields an error:</p>
  
  <pre><code>Warning: pg_query_params(): Query failed: ERROR: parse error - invalid geometry HINT: "POINT($3" &lt;-- parse error at position 8 within geometry in /var/www/html/signup.php on line 26
  </code></pre>
  
  <p>I tried removing the single parens from around point, but that gives this error:</p>
  
  <pre><code>Warning: pg_query_params(): Query failed: ERROR: syntax error at or near "$2" LINE 1: ...geom) VALUES($1, $2, $3, ST_GeomFromText(POINT($3 $2), 4326)... ^ in /var/www/html/signup.php on line 26
  </code></pre>
  
  <p>I realize I can simply insert the latitude and longitude and then separately use these columns to generate the_geom column, but there must be a way to do this in one command while still benefiting from using this params function rather than the usual pg_query. Any recommendations are appreciated. Thanks.</p>