Cloudrunner
06-01-2003, 03:39 PM
Using $DB_site How would I go about testing a table for a specific unique identifier and have the system return a true or false?
What I have so far (and it doesn't work):
(assuming dbase.test[id] is always a unique identifier within the table)
$testrecord = $DB_site->query("SELECT id FROM test WHERE testid = $testid");
if(!$testrecord){
echo "There is no record by this name!";
} else {
echo "Found the record!";
}
All I get is the VB warning stating that there is an error in the database when the record is not found. It works when the record is found though.
Any ideas how I could better test for this scenario? My brain is mushy from coding so long.
Thanks in advance!
Cloudrunner
What I have so far (and it doesn't work):
(assuming dbase.test[id] is always a unique identifier within the table)
$testrecord = $DB_site->query("SELECT id FROM test WHERE testid = $testid");
if(!$testrecord){
echo "There is no record by this name!";
} else {
echo "Found the record!";
}
All I get is the VB warning stating that there is an error in the database when the record is not found. It works when the record is found though.
Any ideas how I could better test for this scenario? My brain is mushy from coding so long.
Thanks in advance!
Cloudrunner