You are here: Re: insert data - « PHP Programming Language « IT news, forums, messages
Re: insert data -

Posted by Pedro Graca on 10/30/06 20:17

VitaminB wrote:
> I try to insert data from a form into a mysql database, but it did not
> work...
>
>
> There is no error,

I think you mean: "I didn't print the error," :)

> but the data did not pass thru the table.
<snip>
> $result = mysql_query("INSERT INTO wholocations(íd', 'lat',
> 'lon','description', ówner', çity', 'street', 'zip', çountry')
> VALUES('0',
> '".$Lat."','".$Lon."','".$Name."' , '".$Owner."' ,'".$City."'
> ,'".$Street."' ,'".$ZIP."' ,'".$Country."')");

If there is an error in your SQL statement, $result will be false and

> echo $result;

this echo will be the same as <?php echo false; ?>
You need to test the return value of mysql_query()

if ($result === false) {
echo 'There was an error in the SQL statement. ';
echo 'The error was: ', mysql_error(), "].<br>\n";
}

> mysql_error();
<snip>

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация