You are here: Re: SELECT'ing from an arry? « PHP Programming Language « IT news, forums, messages
Re: SELECT'ing from an arry?

Posted by Jerry Stuckle on 11/07/07 13:46

dave wrote:
> On Nov 6, 4:15 pm, The Natural Philosopher <a...@b.c> wrote:
>> Austin wrote:
>>> $lines = file("list.txt");
>>> $l_count = count($lines);
>>> for($i = 0; $i < 3; $i++) {
>>> $var = $lines[$i];
>>> }
>>> mysql_query("SELECT name FROM list WHERE name='$var'");
>>> In the list.txt it would have data like:
>>> Code:
>>> One
>>> Two
>>> Three
>>> And "echo $list[0];" would come up as "one".
>>> I need to SELECT the name "one" and return the column data.
>>> It doesn't select anything, even though it does get the data correctly
>>> when echo'd. What's wrong?
>>> OR am I going the wrong way w/ this? :x
>> I am completely baffled. What makes you think that Mysql has anything to
>> do with a file called 'list.txt'?
>
> i'm confused why he expects $var to equal anything but the last
> element in the array $list.
>
>

Just a misplaced right brace...

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp

 

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

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