Sorry! This is some test code. If the table dont have any data, this sub doesn't work, my perl page is not response anything, my browser => "Waiting for localhost..." forever !!! So i cant see any error.
sub checkGroupExist
{
eval{$mysql=Net::MySQL->new(hostname=>"localhost",database=>"check
+k",user=>"root",password=>"pw")};
my ($grname)=@_;
if(!$@)
{
$mysql->query(qq{Select GROUP_NAME from PROJECT_GROUP where GR
+OUP_NAME='$grname'});
my $record_set=$mysql->create_record_iterator();
my $record=$record_set->each();
if($record)
{
return 1;
}
$mysql->close();
}
else
{
print qq{Can't connect to database. Check your config in 'conf
+ig.pl'};
exit;
}
return 0;
}
I see when a perl page run in the browser, there is a program 'perl.exe' in my Window Task Manager. The page load completely and this programe disappear.
With my error, is see in my Task Manager have a task with name 'perl.exe' and it's never disappear. I refresh the page and i have one more!!! | [reply] [d/l] |
Maybe you should remove the CGI part then, and debug the SQL part alone. I don't see anything obvious why your code should fail or enter a long loop. But as you haven't shown a self-contained example, it's hard to tell.
| [reply] |
Yes, i dont understand too.
All of SQL query worked when i test them in phpmyadmin. And my page worked very well if the table in database have greater than two records!!!lol! My perl page look like "loop forever" if mysql tables dont have any record.
I have to insert two record into those tables, if not i cant continue my work.Maybe i must find another server and test them again.
Thanks for reply me :D
| [reply] |