I have renamed the tablename, but now there are other errors:<br><br><b>Warning</b>:  pg_query() [<a href="http://localhost/GpsDaten/function.pg-query">function.pg-query</a>]: Query failed: ERROR:  column &quot;date_start_fahrt&quot; is of type date but expression is of type integer at character 36
HINT:  You will need to rewrite or cast the expression. in <b>C:\ms4w\Apache\htdocs\GpsDaten\GPS_Daten_einlesen.php</b> on line <b>103</b><br><br>
<b>Warning</b>:  pg_query() [<a href="http://localhost/GpsDaten/function.pg-query">function.pg-query</a>]: Query failed: ERROR:  invalid input syntax for type numeric: &quot;&quot; in <b>C:\ms4w\Apache\htdocs\GpsDaten\GPS_Daten_einlesen.php
</b> on line <b>112</b><br>&nbsp;<br><br>php Code:<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; $timestamp=time();<br>&nbsp;&nbsp;&nbsp; $datum=date(&quot;d/m/y&quot;,$timestamp);<br><b></b><br>&nbsp;&nbsp;&nbsp; if($z_eintraege==2)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sql_befehl=&quot;INSERT INTO fahrtenbuchtabelle(fid,date_start_fahrt,date_insert,strecke) VALUES&nbsp;&nbsp;&nbsp;&nbsp; ($z_eintraege,$datum,$datum,GeometryFromText(&#39;LINESTRING($breitengrad1 $laengengrad1, $breitengrad $laengengrad)&#39;,4326))&quot;;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $res=pg_query($connection,$sql_befehl);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sql_befehl_select=&quot;SELECT max(FID) as fid from fahrtenbuchtabelle&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $res_fid=pg_query($connection,$sql_befehl_select);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $fahrtnummer=pg_result($res_fid,&quot;fid&quot;);
<br>&nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; if($z_eintraege&gt;2)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sql_befehl_append=&quot;UPDATE fahrtenbuchtabelle SET strecke=AddPoint(strecke,GeomFromText(&#39;POINT($breitengrad $laengengrad)&#39;,4326)) where fid=&#39;$fahrtnummer&#39;&quot;;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $result=pg_query($connection,$sql_befehl_append);<br>&nbsp;&nbsp;&nbsp; }<br><br>Gerald<br><br><div><span class="gmail_quote">2007/4/13, Obe, Regina &lt;<a href="mailto:robe.dnd@cityofboston.gov">robe.dnd@cityofboston.gov</a>&gt;:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">When you created your table it appears you created it as 
<font color="#000000" face="Times New Roman" size="3">FahrtenbuchTabelle, but in 
your PHP sql, you don&#39;t have the table name quoted, it will take what you have 
and insert into a table called fahrtenbuchtabelle.&nbsp; All table names that 
are not quoted in sql will be lowercased when passed to the 
processor.</font></font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">To minimize on headache, you really should rename your 
table in PostgreSQL to <font color="#000000" face="Times New Roman" size="3">fahrtenbuchtabelle.&nbsp; Note that PostgreSQL table names are case 
sensitive so FahrtenbuchTabelle&nbsp; and fahrtenbuchtabelle are not the same 
name.</font></font></span></div>
<div dir="ltr" align="left"><span></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Other&nbsp;possibly potential problem, I can&#39;t tell how you 
are passing in your $datum date, but may need to be quoted.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Hope that helps,</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Regina</font></span></div><br>
<div dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma" size="2"><b>From:</b> 
<a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">postgis-users-bounces@postgis.refractions.net</a> 
[mailto:<a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">postgis-users-bounces@postgis.refractions.net</a>] <b>On Behalf Of 
</b>Gerald Baumgartner<br><b>Sent:</b> Friday, April 13, 2007 8:14 
AM<br><b>To:</b> <a href="mailto:postgis-users@postgis.refractions.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">postgis-users@postgis.refractions.net</a><br><b>Subject:</b> 
[postgis-users] Problems with PHP and PostgreSQL/PostGIS<br></font><br></div><div><span class="e" id="q_111eae8f193d3195_1">
<div></div>Hi everyone!<br><br>I have created a table and now I want to put a 
GPS Logfile into this table with a php file. But the php file doesn&#39;t do the 
inserts.<br><br>Please can someone help me!<br><br><br><span style="font-weight: bold;">The error message from the php file in 
firefox:</span><br><br><b>Warning</b>: pg_query() [<a href="http://localhost/GpsDaten/function.pg-query" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">function.pg-query</a>]: Query 
failed: ERROR: relation &quot;fahrtenbuchtabelle&quot; does not exist in 
<b>C:\ms4w\Apache\htdocs\GpsDaten\GPS_Daten_einlesen.php</b> on line 
<b>103<br><span style="font-weight: bold;"><br><br></span>Here are the commands 
in the php file</b>:<br><br>&nbsp;&nbsp;&nbsp; 
if($z_eintraege==2)<br>&nbsp;&nbsp;&nbsp; 
{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $sql_befehl=&quot;INSERT INTO 
FahrtenbuchTabelle(FID,Date_Start_Fahrt,Date_Insert,Strecke) VALUES 
($z_eintraege,$datum,$datum,GeometryFromText(&#39;LINESTRING($breitengrad1 
$laengengrad1,&nbsp;&nbsp;&nbsp; $breitengrad $laengengrad)&#39;,4326))&quot;; 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$res=pg_query($connection,$sql_befehl);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$sql_befehl_select=&quot;SELECT max(FID) as fid from 
FahrtenbuchTabelle&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$fahrtnummer=pg_query($connection,$sql_befehl_select);<br>&nbsp;&nbsp;&nbsp; 
&nbsp;<br>&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp; 
if($z_eintraege&gt;2)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$sql_befehl_append=&quot;UPDATE FahrtenbuchTabelle SET 
Strecke=AddPoint(Strecke,GeomFromText(&#39;POINT($breitengrad $laengengrad)&#39;,4326)) 
where FID=&#39;$fahrtnummer&#39;&quot;; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$result=pg_query($connection,$sql_befehl_append);<br>&nbsp;&nbsp;&nbsp; 
}<br><br><span style="font-weight: bold;">And there is my table in 
postgresql/postgis:</span><br><br>CREATE TABLE 
&quot;FahrtenbuchTabelle&quot;<br>(<br>&nbsp; &quot;FID&quot; numeric NOT NULL, <br>&nbsp; 
&quot;Date_Start_Fahrt&quot; date NOT NULL,<br>&nbsp; &quot;Date_Insert&quot; date NOT 
NULL,<br>&nbsp; &quot;Strecke&quot; geometry,<br>&nbsp; CONSTRAINT &quot;FahrtID&quot; PRIMARY KEY 
(&quot;FID&quot;),<br>&nbsp; CONSTRAINT &quot;enforce_dims_Strecke&quot; CHECK (ndims(&quot;Strecke&quot;) = 
2), <br>&nbsp; CONSTRAINT &quot;enforce_geotype_Strecke&quot; CHECK 
(geometrytype(&quot;Strecke&quot;) = &#39;LINESTRING&#39;::text OR &quot;Strecke&quot; IS NULL),<br>&nbsp; 
CONSTRAINT &quot;enforce_srid_Strecke&quot; CHECK (srid(&quot;Strecke&quot;) = 4326) <br>) 
<br>WITHOUT OIDS;<br>ALTER TABLE &quot;FahrtenbuchTabelle&quot; OWNER TO 
postgres;<br><br>Already thankful for any ideas.<br></span></div></div>


<div><p></p><hr size="1"><p></p><br>
<p><strong><br>
The substance of this message, including any attachments, may be<br>
confidential, legally privileged and/or exempt from disclosure<br>
pursuant to Massachusetts law. It is intended solely for the<br>
addressee. If you received this in error, please contact the sender<br>
and delete the material from any computer.<br>
</strong></p></div>
<br>_______________________________________________<br>postgis-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br><br>
</blockquote></div><br>