Re: insert data -
- From: "Petr Vileta" <stoupa@xxxxxxxxxxxxx>
- Date: Tue, 31 Oct 2006 01:36:35 +0100
"VitaminB" <hetmar@xxxxxx> píse v diskusním príspevku news:1162232099.474267.67990@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Guys,
I try to insert data from a form into a mysql database, but it did not
work...
<?php
print_r($_POST);
$link = mysql_connect("aaa", "aaa", "aaa")
or die("Could not connect: " . mysql_error());
mysql_selectdb("db182527668",$link) or die ("Can\'t use
dbserver : " . mysql_error());
$Lat = $_POST['Lat'];
$Lon = $_POST['Lon'];
$Name = $_POST['Name'];
$Owner = $_POST['Owner'];
$City = $_POST['City'];
$Street = $_POST['Street'];
$ZIP = $_POST['ZIP'];
$Country = $_POST['Country'];
$result = mysql_query("INSERT INTO wholocations('id', 'lat',
'lon','description', 'owner', 'city', 'street', 'zip', 'country')
VALUES('0',
'".$Lat."','".$Lon."','".$Name."' , '".$Owner."' ,'".$City."'
,'".$Street."' ,'".$ZIP."' ,'".$Country."')");
It is curious syntax :-) Try this:
$query = "INSERT INTO wholocations('id', 'lat',
'lon','description', 'owner', 'city', 'street', 'zip', 'country')
VALUES('0', $Lat, $Lon, $Name, $Owner , $City, $Street, $ZIP, $Country)";
$result = mysql_query($query) or die(mysql_error());
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail from another non-spammer site please.)
.
- Follow-Ups:
- Re: insert data -
- From: strawberry
- Re: insert data -
- References:
- insert data -
- From: VitaminB
- insert data -
- Prev by Date: Re: PHP + Upload + picture script
- Next by Date: Re: Parse .cfm files
- Previous by thread: Re: insert data -
- Next by thread: Re: insert data -
- Index(es):
Relevant Pages
|