You are here: Re: to insert array value in database---important « PHP Programming Language « IT news, forums, messages
Re: to insert array value in database---important

Posted by Jerry Stuckle on 10/30/37 11:28

garimapuri@gmail.com wrote:
> hi
> ihad an array in php and iwant to insert its value in database
> the coding is:
>
> <?php
> $nv_pairs = explode('&',$query_string);
> $array[50];
> list ($name, $value) = explode ('=',$nv_pairs);
> $i = 0;
> foreach($nv_pairs as $array[$i]) {
> $array[$i]=
> preg_replace('/\%0d%0a+/',"<br> &nbsp;&nbsp;&nbsp;&nbsp;
> ; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> ; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> ; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> ; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> ; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> ; ",$array[$i]);
> $array[$i]= urldecode ($array[$i]);
> $array[$i]= preg_replace('/\d*\=/', " ",$array[$i]);
> $array[$i]= urldecode ($array[$i]);
> $i++;
> }
> ksort($array);
> while(list($key,$value)=each($array)) {
> if (preg_match("/\d+/",$value)) {
> echo "<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
> &nbsp;&nbsp;&nbsp;<b>$value</b>";
> }
> else {
> echo " <b>$value</b>";
> }
> }
> ?>
>
> now how can $value be put in database or the ksort value of
> array
>

Which database? Do you want to put the array all in one row, or
multiple rows?


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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