The reason for a second sentence in my question " as it can hold any datatype as string." is to make the question more specific from the view of it so that people will really get the actual picture before going to the answers.
i have asked this question after posting and getting responses to this question. according to those responses i have planned to do it this way. i am just mentioning it here and if you have time then you can go through. because this current question has been raised after that.
aşağıdaki gibi, mevcut quesiton olan ...
- Ben varchar veri türü olan bir alan yaşıyorum.
- varsayılan olarak null.
- o ya da bu görüntü yüklendiği zaman damgası değeri (bir görüntünün dosya olan) null veya dize ya tutacaktır.
- Null ya da zaman damgası değeri tamsayı değeri ise o zaman ben hiç Image.jpg görüntülemek istiyorsanız.
- bir dize ise ben bu görüntüyü gösterecektir böylece o gerçek görüntüdür.
- alan null veri türü tutar ise o zaman hiçbir görüntü yüklendi.
- Bir zaman damgası değeri ise o kullanıcıların hala onun yüklenen görüntü manipüle edilir.
- bir dize ise o görüntülenecek hazır gerçek görüntüdür.
- yüklenenler sadece bir kişi tarafından yapılır.
yani, ben bir sorgu yürütme am ve i varchar değeri null veya tamsayı ya da bir dize olup olmadığını bulmak istiyorum.
i php daha fazla hesaplama yapmak istemiyorum. bunu ben sql bir seçenek olmalıdır umuyoruz.
Eğer sql (bunu çözme veya php içinde çözerek) hem de cevap vermek istiyorum hissediyorum eğer o da gayet iyi.
burada ben php yapmak planladığımız budur.
$val = $rs['filename'];
if(is_null($val)) // display a noimage.jpg
else if(is_numeric($val)) // display a noimage.jpg
else // display the actual image.
ne i sql beklemek boş veya tamsayı sonra ben gerçek görüntü olarak anahtar kelime ve başka bir 'noimage.jpg' olarak kullanmak eğer bir işlevi çağırmak ve bir ...
select somefunction(filename) as something.... the something should hold noimage.jpg if the value is null or integer. if the value is a string then it should hold the actualimagename.
i açıkça umuyoruz.