Hello,
I have to questions about some coding.
* I have some nummeric code that I need to fetch thats working partly. if I use this if ($cur_group =~ /222/) { $section_started=1; } code is being fetched but not only code after 222 also code after 37222 or 32222 how can I be sure the script only decodes 222 and nothing else?
* I need to put data in to a mysql thats working data is being put in by this code;
$sth= $DBH -> prepare("SELECT id from hour WHERE id=$NAME"
$sth -> execute() || print "CANT EXEC";
if(!($sth->fetchrow)) {
$inserts++;
$DBH ->do("INSERT INTO hour VALUES ($NAME,$NINE_CODE_PHENO)" ||
print "Can't add value. Reason: $DBI::errstr $new_idx<BR>
INSERT INTO hour VALUES ($NAME,$NINE_CODE_PHENO)<BR>";
}
When id is already in the dbase it has to add it, not update the old data. What is wrong or is it already working?
Hope you understand my needs.
Greatings
Marcel
I have to questions about some coding.
* I have some nummeric code that I need to fetch thats working partly. if I use this if ($cur_group =~ /222/) { $section_started=1; } code is being fetched but not only code after 222 also code after 37222 or 32222 how can I be sure the script only decodes 222 and nothing else?
* I need to put data in to a mysql thats working data is being put in by this code;
$sth= $DBH -> prepare("SELECT id from hour WHERE id=$NAME"
$sth -> execute() || print "CANT EXEC";
if(!($sth->fetchrow)) {
$inserts++;
$DBH ->do("INSERT INTO hour VALUES ($NAME,$NINE_CODE_PHENO)" ||
print "Can't add value. Reason: $DBI::errstr $new_idx<BR>
INSERT INTO hour VALUES ($NAME,$NINE_CODE_PHENO)<BR>";
}
When id is already in the dbase it has to add it, not update the old data. What is wrong or is it already working?
Hope you understand my needs.
Greatings
Marcel