You are here: Re: textarea selection « PHP Programming Language « IT news, forums, messages
Re: textarea selection

Posted by Moot on 10/12/06 18:32

Lucas Byers wrote:
> Hey all,
>
> I'm trying to create a php tool for local use where I put a
> list of words (one on each line) in to a textbox and it takes each word
> and creates an entry in an sql table.
>
> So I'd put
>
> hey
> ho
> whats
> up
> yes
> no
> maybe
>
> and it'd go through each word and create a seperate entry so 1 for hey,
> 1 for ho, and so on.
>
> Is there a way to
>
> a) get how many rows there are in to php?
> b) select each row and grab it's contents?
>
> Thanks for your time.

Simply do an explode on newlines to get the lines into an array, then
process the array into sql however you see fit.

$myArray = explode("\n",$_POST['myTextArea']);

foreach($myArray as $line){
$line = trim($line);
//do some sql stuff here
}

 

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

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