Thanks Spookie for verifying what I thought I shoudl do. Yes it's a LOT easier to do a database hit than it is to attempt to 'cache' the results. I was reading up on creating an external file and temporary SQL tables which are a maintenance nightmare in the long run.
I'm new to html programming, perl and the like...and need advice and could use a few insights on how to tackle this problem.
I'm writing the paging part of a simple search web application where a query returned more results than it can display. I'm using perl, cgi, html templates and mysql.
I...
Ok, I think avoiding the complex multidimensional array is a good idea! It wasn't my code, it's currently in an existing program that I need to work around. O.o
The data is read into a structure like I described before and i figured out a way to put it into a simpler structure and yet not...
I wrote a validation routine to handle invalid input but if the user types in a single or double quote in the first column of any text input in a html page, then the code appears in the input box:
<input id="itemNum" type="text" name="itemNum" value='>
I'm unsure how to handle this. I'm...
I'm going to have to try it today in a .pl program.
It differs in this way: in my cgi script..when I type:
$debug2Template->param(s4=>"listprice: $row{'00001'}->{'LISTPRCE'}";
I'd expect to see the listprice that I just init'ed with $row with. But instead, it's blank. But if i replace...
Agh!
I was mistaken. Removing the quotes did not make any difference.
I want this as a result:
$row{'00001'} = {'ITEMDESC'=> $data_row[1], ... etc}
without having to hardcode the '00001' into the assignment statement like so:
$row{$data_row[0]} = {'ITEMDESC'=> $data_row[1], ... etc}...
Hello all,
I want to add to a hash, values read in after a sql sth read.
while (my @data_row = $sth->fetchrow_array){
#$row {'00001'} = {'ITEMDESC' => $data_row[1],
$row {"$data_row[0]"} = {'ITEMDESC' => $data_row[1],
'LISTPRCE' => FormatPrice($data_row[2]),
'ITEMQTY' => $data_row[3]...
Hello Chris,
After reading your post, y'know that's what I do (yeah caught me at a lie *gasp* It was crazy yesterday..sorry.) What I do is I pass parms to the display cgi, it queries, it displays the results.
Right now, if the user wants to sort on another column, it requeries and sorts it...
Hrmm..I like that solution...inserting the selected word when the list is being generated. That's actually what I want.
BUT..I've already put in the code to have the top option always selected and inserted the user's choice there (where it starts at the defaulted value for that type of...
Hello all,
I hope I'm posting in the right forum. O.o
Data is going from cgi to form...given a value for a drop down box choice, and given also that the drop down box values are dynamically generated. How can you preserve the value of a drop down box choice a user has chosen after it's been...
Nm! I just discovered dereferencing ($$)! wowee. ok, I have a lot to do today and when (and if) I'm able to get back to this subject, I'll use that in my sort command.
I believe that was the source of my problem..I didn't know how to DE-reference a referenced variable. :))
One problem...
Thanks for taking the time to help me.
I've been thru several references and many tutorials for the last few days..I'm sure one more won't hurt me.
Ok, here it is..the code that inits the array of hashes.
<do the query sql statement here>
my @rows;
while (my...
I wish I could simply use Data::Dumper to display this array of referenced hashes but it's in a cgi script and that script gets info that's run by another cgi script...like so:
1. Input.cgi : asks for 10 or so values (user hits submit)
2. display.cgi: sql query done here and then displayed...
Hello Keith,
Thanks for your reply. :)
Yah, the pseudocode I provided is rather loose. I should have posted this comment with it: "assume all work code to be done across 3 to 4 cgi's and multiple displays after each results are achieved for each cgi." (ie. sort.cgi sorts an array of stuff...
Hello all,
I'm fairly new to cgi scripting, html templates and perl. I am trying to sort an array of hash (which represents rows of a table) and having trouble with passing the data from html to cgi script (so I can sort). I know how to pass the array to the template but not vice versa...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.