[sqlite] input using a dropdown list

2016-05-23 Thread Gary Ehrenfeld
Everything works great. Again I had another typo but I saw it and once fixed 
run great.

Thank you for all your help.

On 5/22/16, 16:45, "Simon Slavin"  wrote:

>
>On 23 May 2016, at 12:37am, Gary Ehrenfeld  wrote:
>
>> It works but how do I get it to work with an input statement so I can insert 
>> it into the hive_type column in the hive table.
>
>I don't see anything you did wrong.  Have it construct the  and 
> tags, View the Source of the page and look at the HTML it constructs. 
> If you can't figure it out, break it into two test chunks:
>
>One chunk makes a  and  from fixed text.  Don't do any SQLite.
>
>One chunk reads the SQLite rows, but makes just displays them in  
>paragraphs.
>
>Simon.
>___
>sqlite-users mailing list
>sqlite-users at mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users




[sqlite] input using a dropdown list

2016-05-23 Thread Simon Slavin

On 23 May 2016, at 12:37am, Gary Ehrenfeld  wrote:

> It works but how do I get it to work with an input statement so I can insert 
> it into the hive_type column in the hive table.

I don't see anything you did wrong.  Have it construct the  and 
 tags, View the Source of the page and look at the HTML it constructs.  
If you can't figure it out, break it into two test chunks:

One chunk makes a  and  from fixed text.  Don't do any SQLite.

One chunk reads the SQLite rows, but makes just displays them in  paragraphs.

Simon.


[sqlite] input using a dropdown list

2016-05-22 Thread Simon Slavin

On 22 May 2016, at 11:57pm, Gary Ehrenfeld  wrote:

> I corrected the results to result and everything works. Thank for seeing 
> that. I feel really stupid right now.

Don't feel bad.  We've all done it.  Second pair of eyes always helps.

Simon.


[sqlite] input using a dropdown list

2016-05-22 Thread Simon Slavin

On 22 May 2016, at 11:46pm, Gary Ehrenfeld  wrote:

> Yes. Here is the code I am using but when I run it all I get is an empty list.

Just as a test, replace your code which makes the dropdown list with code which 
just shows the options on the display:

"".$value.""

Get that working first, then worry about a dropdown list.

>$result = $dbh->query($sql);
>while ($row = $results->fetchArray($result))

That looks wrong.  Try to distinguish between your two variables $result and 
$results .

Simon.


[sqlite] input using a dropdown list

2016-05-22 Thread Simon Slavin

On 22 May 2016, at 11:15pm, Gary Ehrenfeld  wrote:

> Any suggestions? I am using SQLIte3 and PHP.

Before you try to make a dropdown list with options taken from a SQLite 
database, do you know how to make a dropdown list with fixed text options ?

Simon.


[sqlite] input using a dropdown list

2016-05-22 Thread Gary Ehrenfeld
It works but how do I get it to work with an input statement so I can insert it 
into the hive_type column in the hive table.

On 5/22/16, 15:58, "Simon Slavin"  wrote:

>
>On 22 May 2016, at 11:57pm, Gary Ehrenfeld  wrote:
>
>> I corrected the results to result and everything works. Thank for seeing 
>> that. I feel really stupid right now.
>
>Don't feel bad.  We've all done it.  Second pair of eyes always helps.
>
>Simon.
>___
>sqlite-users mailing list
>sqlite-users at mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users




[sqlite] input using a dropdown list

2016-05-22 Thread Gary Ehrenfeld
I corrected the results to result and everything works. Thank for seeing that. 
I feel really stupid right now. 

On 5/22/16, 15:51, "Simon Slavin"  wrote:

>
>On 22 May 2016, at 11:46pm, Gary Ehrenfeld  wrote:
>
>> Yes. Here is the code I am using but when I run it all I get is an empty 
>> list.
>
>Just as a test, replace your code which makes the dropdown list with code 
>which just shows the options on the display:
>
>"".$value.""
>
>Get that working first, then worry about a dropdown list.
>
>>$result = $dbh->query($sql);
>>while ($row = $results->fetchArray($result))
>
>That looks wrong.  Try to distinguish between your two variables $result and 
>$results .
>
>Simon.
>___
>sqlite-users mailing list
>sqlite-users at mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users




[sqlite] input using a dropdown list

2016-05-22 Thread Gary Ehrenfeld
Yes. Here is the code I am using but when I run it all I get is an empty list.


query($sql);
while ($row = $results->fetchArray($result))
{
$value=$row["type"];
$options.="".$value;
}
?>






On 5/22/16, 15:35, "Simon Slavin"  wrote:

>
>On 22 May 2016, at 11:15pm, Gary Ehrenfeld  wrote:
>
>> Any suggestions? I am using SQLIte3 and PHP.
>
>Before you try to make a dropdown list with options taken from a SQLite 
>database, do you know how to make a dropdown list with fixed text options ?
>
>Simon.
>___
>sqlite-users mailing list
>sqlite-users at mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users




[sqlite] input using a dropdown list

2016-05-22 Thread Gary Ehrenfeld
I have a table named hives and one of the fields is named hive_type.

I have another table named hive_type with a single field name type.

I have tried several methods with not luck.

I want to populate hives.hive_type with a selections from a dropdown list from 
hive_type.type

Any suggestions? I am using SQLIte3 and PHP.