Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Perl/MySql/php Multiple Insert

5:13 am on Feb 24, 2012 (gmt 0)

New User

joined:Feb 24, 2012
posts: 11
votes: 0

we have domain search script in perl this script call from php using exec() command .when call the perl script from php with some domain name and userid then perl script crawl the domain detail and insert into mysql table .table names are [domain,host] so its working .problem is when 2 user search same time perl script insert insert some data of 1 user to 2 user detail viceversa
6:58 am on Feb 24, 2012 (gmt 0)

New User

joined:Feb 24, 2012
posts: 11
votes: 0

am explain more

for example we have 2 database first one have detail of all domain name and subdomian name owner and so this is referenced database another one is used to save the search result of user. we have a php page when user enter the some domain name domain1.com and click search then php page call perl script with system(""perl /opt/disco/crawlr.pl -v -d $domain $userid > /dev/null &"");. perl script search the data about this domian1.com name from database1 then insert into detail to database2 with search key and userid and domain name subdomain name and so.this script working well when only one user search at a time.when 2 user search 1 user using domain1.com and 2 user using domain2.com then perl script search the detail from database1 and insert into database 2 but problem is result is mixed between 2 user i mean we have a coloumn name domain,userid actual result is domain |userid domain1.com |1 sub1.domain1.com|1 sub2.domain1.com|2 domain2 |2 sub1.domain2.com|2 sub2.domain2.com|2 but my result domain |userid domain1.com |1 sub1.domain1.com|2 sub2.domain1.com|1 domain2 |2 sub1.domain2.com|1 sub2.domain2.com|2 i thing this is clear"
8:59 pm on Feb 26, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:May 8, 2008
posts: 74
votes: 0

Please write more clearly next time.

What is the name of mysql table?
1:29 pm on Mar 3, 2012 (gmt 0)


WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
votes: 8

welcome to WebmasterWorld, dartsuresh!

from your description it is impossible to tell if this is a perl problem or a database concurrency problem.

what type of database do you have?
are you using mod_perl on your server?
what methods have you tried while debugging the problem?