You are here: Re: reading contects of a file « PHP Language « IT news, forums, messages
Re: reading contects of a file

Posted by Jim Michaels on 11/21/41 11:37

use mysql_escape_string() on your data before doing your INSERT to put it
into the database.
UPDATE will not put new data into the database. it will only UPDATE what is
already there.
mysql_query("INSERT INTO tablename(blobcolumn,column2) VALUES
('".mysql_escape_string($par)."','otherdata')", $link);
if you want to use an UPDATE,
mysql_query("UPDATE tablename SET blobcolumn='".mysql_escape_string($par)."'
WHERE id=$someid", $link);
when you want the data out, use stripslashes() on the output.

"William Young" <info2@educationalstays.com> wrote in message
news:43c105bb$0$10085$ba620dc5@text.nova.planet.nl...
> Hello all,
>
> I want to read the contents of a html file into a blob field in my mysql
> database.
>
> The function $par = file_get_contents($p1);
>
> p1 is the file field. I need the html source code with all the tags to be
> placed into the database by an UPDATE.
>
> It doesnt work somehow, but i dont know what the error is.
>
> Can someone please help me out here?
>
> William
>
>
>

 

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

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