Welcome Guest, Not a member yet? Register   Sign In
DB Query Returns
#5

[eluser]Daburn[/eluser]
Jup, I have different fields like id, name, symbol, price etc.

I now can do it like:
Code:
if (strlen($value->id) == 0) $value = "keine Bier heute :(";
if (strlen($value->name) == 0) $value = "keine Bier heute :(";
if (strlen($value->symbol) == 0) $value = "keine Bier heute :(";
etc.
But that's not what I want, since I don't know how the field are named nor how many I will have in the end.

So I want to solve that with a loop. Something like
Code:
foreach (go through all the fields of stocks) {
   if (strlen($value->however_the_current_field_is_named) == 0) $value = "keine Bier heute :(";
}
Now what I mean? Smile


Messages In This Thread
DB Query Returns - by El Forum - 10-19-2007, 08:11 AM
DB Query Returns - by El Forum - 10-19-2007, 08:18 AM
DB Query Returns - by El Forum - 10-19-2007, 08:22 AM
DB Query Returns - by El Forum - 10-19-2007, 08:30 AM
DB Query Returns - by El Forum - 10-19-2007, 08:38 AM
DB Query Returns - by El Forum - 10-19-2007, 09:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB