Solved

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

Posted on 2008-10-21
2
149 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
Comment Utility
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
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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 remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

10 Experts available now in Live!

Get 1:1 Help Now