[htmltmpl] New to this - conditional problem i think
Brought to you by:
samtregar
From: Thomas N. <th...@te...> - 2005-01-21 10:26:22
|
Hi all I'm new to html-template and fairly new to perl too. Anyway I have managed to set up a html form that inputs certain values to a perlscript which in turn queries an mysql database and then outputs the results using html:template and it works very nicely with one exception. If i enter a value in the form that is not in the database i receive an error. Since i use push @{$rows}, $_ while $_ = $sth->fetchrow_hashref(); i figured..hey this is a hash so i can use if (exists $rows{$fornamn}) etc .. but alas no. apparently push gets an array and not a hash if I now get it correctly. Anyway, i was thinking, maybe i can set a conditional in the template so that depending on the value of a row i can output different html code. What i need is to alert the uses that his or her query resulted in no hits. I tried searching in the list but i'm not quite sure what to search for. I would very much appreciate it if someone could help me in the right direction. Thanks |