<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18828"></HEAD>
<BODY 
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV dir=ltr align=left><SPAN class=076341919-27102009>André ,</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=076341919-27102009><FONT color=#0000ff 
size=2 face=Arial>You could also output the error right on the php page by 
trapping it along the lines of</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=076341919-27102009><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=076341919-27102009><FONT color=#0000ff 
size=2 face=Arial><A 
href="http://www.php.net/manual/en/function.pg-result-error.php">http://www.php.net/manual/en/function.pg-result-error.php</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=076341919-27102009><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=076341919-27102009><FONT color=#0000ff 
size=2 face=Arial>Personally - I tend to use an abstraction layer like PHP ADODB 
or PEAR.   It makes your code a bit more portable, and also much less 
to remember about the nuances of connecting</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=076341919-27102009><FONT color=#0000ff 
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=076341919-27102009><FONT color=#0000ff 
size=2 face=Arial><A 
href="http://www.postgresonline.com/journal/index.php?/archives/42-REST-in-PostgreSQL-Part-2-B-The-REST-Server-service-with-PHP-5.html#extended">http://www.postgresonline.com/journal/index.php?/archives/42-REST-in-PostgreSQL-Part-2-B-The-REST-Server-service-with-PHP-5.html#extended</A></FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=076341919-27102009></SPAN><FONT face=Arial><FONT 
color=#0000ff><FONT size=2>H<SPAN class=076341919-27102009>ope that 
helps,</SPAN></FONT></FONT></FONT></DIV>
<DIV><SPAN class=076341919-27102009></SPAN><SPAN 
class=076341919-27102009></SPAN><FONT face=Arial><FONT color=#0000ff><FONT 
size=2>R<SPAN 
class=076341919-27102009>egina</SPAN></FONT></FONT></FONT><BR></DIV>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> 
postgis-users-bounces@postgis.refractions.net 
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of </B>Moen, 
Paul T.<BR><B>Sent:</B> Tuesday, October 27, 2009 9:18 AM<BR><B>To:</B> PostGIS 
Users Discussion<BR><B>Subject:</B> Re: [postgis-users] pg_query to insert new 
point<BR></FONT><BR></DIV>
<DIV></DIV>Try to look at the web server error logs as well.  On unix they 
are usually in /var/log/apache2/ or /var/log/httpd/ and named error_log or 
error.log.  I don't know where they are on windows systems, but maybe 
someone else could point you in the right location.  You could also use 
pg_last_error ($con); or pg_last_notice($con); to see the last error that would 
have been written to the log.  
<DIV><BR>
<DIV>Paul <BR><BR></DIV><BR>
<DIV>
<DIV>On Oct 27, 2009, at 2:33 AM, <<A 
href="mailto:nicklas.aven@jordogskog.no">nicklas.aven@jordogskog.no</A>> 
<<A 
href="mailto:nicklas.aven@jordogskog.no">nicklas.aven@jordogskog.no</A>> 
wrote:</DIV><BR class=Apple-interchange-newline>
<BLOCKQUOTE type="cite">
  <DIV>
  <DIV align=left>It might be that the webserver don't have authentication to 
  access the database.</DIV>
  <DIV align=left>That is controlled from the file pg_hba.conf in the 
  data-directory in the postgresql installation.</DIV>
  <DIV align=left>You should also check the file postgresql.conf in the same 
  directory. At least if the webserver is on another machine than postgresql you 
  have to change the line about listen_addresses so it looks like:</DIV>
  <DIV align=left>listen_addresses = '*'</DIV>
  <DIV align=left>if you want to let all ip-addresses in.</DIV>
  <DIV align=left> </DIV>
  <DIV align=left>I don't know the details herer, but it might help you continue 
  digging :-)</DIV>
  <DIV align=left> </DIV>
  <DIV align=left>/Nicklas<BR><BR>2009-10-27 André Mendonça wrote:<BR><BR>Hi 
  everyone, first e-mail here.<BR>>I´m trying to insert a new point to a 
  simple table called processos in a postgis database, using php, in a local 
  server, with apache 2.2, php 5.2.12, postgre 8.3 and postgis 
  1.4.<BR>><BR>>here is the piece of code:<BR>><BR>>$sql = "INSERT 
  INTO processos (id, the_geom) VALUES (1,(ST_PointFromText('POINT(-2 
  -62)',4291)))";<BR>>pg_query($con, 
  $sql);<BR>><BR>><BR>><BR>><BR>>I can observe (with 
  pg_affected_rows) there´s no new record.<BR>><BR>>Executing the same 
  query directly in pgsql, with the same database user, returns a successfully 
  result. <BR>><BR>>Any ideas on what´s wrong? I had never done any 
  queries using php before, is there a way to see an error message when 
  executing this kind of server-side request? tried firebug console but there´s 
  nothing going on there...<BR>><BR>>Thanks a lot!<BR>><BR>>André 
  Mendonça<BR>>Universidade Federal do Paraná<BR>>Curitiba - 
  BR<BR>><BR>><BR>><BR>></DIV>
  <HR>
  Com o Novo Internet Explorer 8 suas abas se organizam por cor. <A 
  href="http://brasil.microsoft.com.br/IE8/mergulhe/?utm_source=MSN%3BHotmail&utm_medium=Tagline&utm_campaign=IE8">Baixe 
  agora, é grátis!</A> 
  </DIV>_______________________________________________<BR>postgis-users mailing 
  list<BR><A 
  href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A><BR>http://postgis.refractions.net/mailman/listinfo/postgis-users<BR></BLOCKQUOTE></DIV><BR></DIV><BR><BR>__________ 
Information from ESET NOD32 Antivirus, version of virus signature database 4547 
(20091027) __________<BR><BR>The message was checked by ESET NOD32 
Antivirus.<BR><BR><A 
href="http://www.eset.com">http://www.eset.com</A><BR></BODY></HTML>