Bir tablo alanı boş değilse, bir form alanını ayarlama

0 Cevap

Ben aşağıdaki kodu vardır:

$theinput = new inputSmartSearch($db,
    "chooseproduct", "Choose Product", $therecord["product"],
    "Choose Product", TRUE, NULL, NULL, TRUE, $required=true);
$theinput->setAttribute("class","important");
if(isset($therecord["product"]) || isset($therecord["cost"])) {
    $theinput->setAttribute("value",
        $therecord["product"] . ", " . $therecord["cost"]);
}

inputSmartSearch Ben kullanıyorum bir CMS sistemi için form alanının bir türüdür.

Ben sürece boş değil gibi, varsayılan formun değerini ayarlamak için yapmak isteyen ben ne, "," olacak bir varsayılan değere sahip önlemek için.

var_dump($therecord["product"]); 

gösterir string (0) "", kesinlikle boş yani.

Neden sonra "," Hala benim form alanının varsayılan değer olarak ayarlanır ediliyor?

0 Cevap