Solved

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

Posted on 2008-10-21
2
160 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Six Sigma Control Plans

624 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