Solved

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

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

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

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…

830 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