Solved

updating database but update.pl script fails?   see attached files

Posted on 2008-10-21
2
155 Views
Last Modified: 2011-10-19
I have an update.pl script   it downloads data from the mls and puts in db on server but I am now getiting error.  DBD::mysql::st execute failed: Unknown column 'photos_count' in 'field list' at                                               ./load_photos.pl line 11
load_photos.pl = 
#!/usr/bin/perl
 
use DBI;
chdir('/home/httpd/vhosts/xxxx.com/subdomains/lasvegas/httpdocs/mls');
my $dbh = DBI->connect ("DBI:mysql:lasvegas", 'lasvegas', 'monday');
my @rows = `cat photo_count.txt`;
foreach my $row (@rows) {
 chomp $row;
# print "$row\n";
 $sth = $dbh->prepare($row);
 $sth->execute;
 $sth->finish if ($sth);
}
$dbh->disconnect;
  line 11=  $sth->execute;

Open in new window

load-photos.txt
update.txt
lasvegasfixsql.txt
0
Comment
Question by:webguy62
2 Comments
 
LVL 39

Accepted Solution

by:
Adam314 earned 500 total points
ID: 22772510
In your photo_count.txt file, you have a SQL statement that refers to the field photos_count in some table, but that table in your database does not have a photos_count field.
0
 

Author Closing Comment

by:webguy62
ID: 31508552
I added new field to table class_5= photos_count then ran update .pl  it seems to be working now....  thanks big time
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question