I have this function in a while loop and for some reason it says all records are duplicates.
I have tried:
$tst->RecordCount() === 1
$tst->RecordCount() == 1
$tst->RecordCount() = 1
$tst->RecordCount() === '1'
$tst->RecordCount() == '1'
$tst->RecordCount() = '1'
$tst->RecordCount() === "1"
$tst->RecordCount() == "1"
$tst->RecordCount() = "1"
But none seem to work
$sql45 = "SELECT
count(*)
FROM
companies
WHERE
MC = " . $test;
$tst = $conn->Execute($sql45);
if ($tst === false) die("horrible death:" . $conn->ErrorMsg() . " SQL: " . $sql45);
if($tst->RecordCount() === 1){
echo $test . "<br>";
echo "Duplicate record <br>";
continue;
}
this is what i recieve
545481
Duplicate record
45
Duplicate record
11111
Your record count is ALWAYS going to be 1. You're have
SELECT count(*) FROM companies WHERE MC = somevalue
This always returns a single row, aka a record count of 1. Perhaps it is the VALUE of the count that you are trying to get?