Solved

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

Posted on 2008-10-21
2
152 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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 …
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

912 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now