I have a number 171500 It should be 1715.00 I have tried using this
$field3 = sprintf("%.2f",$field3);
but it gives me this 171500.00
How do I add the decimal in the proper place?
Thanks, I will give this a try.
This is correct. My goal is to get rid of the email field in the einfo table as it is redundant. but before I do I need to make sure the information is moved.
I have two tables with common fields (id number and email) I would like to write an update statement that would place the value for field email in table one into field email in table two if field email is empty in table 2 and there is a value in field email in table one.
This is what I tried...
I'm dealing with anywhere from 50 to 200 comments per loan. So it is best to use sql to trim it to five. I can see how the sql can get complex. That is why I was using the two queries, this just takes a long time. But if you could give me an idea on how to start with this I would be greatly...
I'm looking to get all the information in the first query plus the last 5 comments for each loan selected in the first query.
The first query will return about 9000 records
I was hoping there was some function like
Left Join comments on loaninfo.loannumber=comments.loannumber LIMIT 0, 5...
here is a query I run
I then get the results run them thru a loop and run this query on every result of the previous query. $lnb is the loannumber selected in the above query.
I then display the results of the first query with the last five comments for that loan.
this works but is slow...
So after some thinking I did this.
I set the following in the Apache web server
<Directory "/some/folder/name/">
order deny,allow
deny from all
allow from localhost
</Directory>
This in essence allowed only programs on the local machine to access the directory.
Then I place...
I have a site which requires a username and password to access. With in this site is some directories with pdf files.
I use perl to decide what pdf files to display and links to them for downloading based on there username.
This works great, however if some were to find out the name of one of...
ok,
now I'm really confused. Is my above code that bad? or are you guys just giving me a hard time. Again here is the completed code.
$run_ealert = $dbh->prepare( $ealert_query );
$run_ealert->execute();
$total_emails = 0;
while (@alert = $run_ealert->fetchrow_array) {...
Just to clarify what I was doing
$total_emails = 0; #<---what is this for?
this is setting the number of emails to 0
$total_emails++; #<---what is this for?
This adds one for each email(ie alert) going out.
$temp_text = $ealert_text;#<-- this makes no sense to me.
my text for the alert...
ok,
Problem resolved. I was not print the proper var in the sub routine. My Mistake.
I do appreciate all the help with the regular expression.
Great bunch here.
$ealert_text is my text that contains the ShowField4 and ShowField5 and so on.
I then run a query to get the data put it in the @alert array.
It is this data that is different for every record it finds.
I then set the a new var $temp_text = to $ealert_text so as to not change the original...
Kevin,
Thanks.
Your seems to work as well. appreciate it.
The problem I have now is that I need it to run for every record I find.
Here is what I have so far.
$run_ealert = $dbh->prepare( $ealert_query );
$run_ealert->execute();
$total_emails = 0;
while (@alert =...
plunkett,
Thanks for the explanation. Appreciate it.
Your above question is correct but reversed. $ealert_text does not change and the $temp_text should reset to $ealert_text then go thru the for loop and pass off to the sub on each iteration.
Plunkett,
Thanks. This works. However when I run it in a while statement as it needs to run multiple times I need to get the text to reset back to the original text.
Also could you give me a brief explanation on what is happening on this line.
$text =~ s/(\$\w+\[[0-9]+\])/$1/eeg;
Just to clarify in the second bit of code I have also changed the $ealert_text in the for loop to $temp_text so the code looks like this:
$temp_text =~ s/ShowField${c}/$alert[$c]/g;
just forgot to add that in the first post.
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.