I've been struggling for a couple hours with attempting to check verify that a value in a database does not exist. I suspected that db:is_nil would be the function I need. But I cannot seem to figure out how to get it to return accurately. Either everything is Null or nothing is. The function I've been trying to add the detection to is:
Thank you for any advice you can offer!
Code: Select all
function findItemID(itemName) local itemsQuickDatadb = db:get_database("itemsQuickData") itemData = db:fetch(itemsQuickDatadb.item, db:eq(itemsQuickDatadb.item.inventoryName, itemName)) itemID =(itemData["_row_id"]) fg("light_goldenrod") echo(" [Item #"..itemID .. "]") resetFormat() end