Closed (won't fix)
Project:
Views Custom Field
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Feb 2009 at 15:37 UTC
Updated:
31 Jan 2011 at 17:51 UTC
My PHP-Code is disappearing when i'm using an if-form with "else". For example:
$available = mysql_query("SELECT anzahl FROM belegung WHERE nid = $data->nid");
while ($row = mysql_fetch_object($available))
{
echo $row->anzahl;
};
works but
$available = mysql_query("SELECT anzahl FROM belegung WHERE nid = $data->nid");
while ($row = mysql_fetch_object($available))
{
if (!is_null($row->anzahl))
{
echo $row->anzahl;
}
else
{
echo "Alle Plätze belegt";
}
}
doesn't work anymore.
Is it a stupid fault in the syntax or a bug ? I tried my code on another form and it worked all fine, so i put this issue as a "bug report" as a precaution. Also there is no error message, it simply disappears from the form.
Comments
Comment #1
casey commentedSee #346216: All code in long custom field is discarded
Sorry, but I won't update the D5 version because I don't use it on the moment and D6 isn't stable yet. patches are welcome though.
Comment #2
lzimon commentedThanks for your reply.
the solution is
So you have only to increase the length of your databasefield to make longer scripts work.
Comment #3
casey commentedD5 version is no longer supported (wasn't for a long time to be honest).