php - Show image based on label - jQuery Datatables -
I'm trying to show images based on some labels with the jQuery
datatables.
& lt ;? Php while ($ row = mysql_fetch_array ($ result2)) {? & Gt; & Lt; TR & gt; & Lt; TD & gt; & Lt ;? = $ Line ['ip'] & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt ;? = $ Line ['agent'] & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt ;? = $ Line ['verified'] & gt; & Lt; / TD & gt; If ($ line ['label'] == "other") {& lt; Td> & Lt; Img src = "imgb.png" & gt; & Lt; / Td> } Other {& lt; Td> & Lt; Img src = "imgc.png" & gt; & Lt; / Td> } & Lt; / Tr & gt; & Lt ;? Php}? & Gt; The problem is that 'if part' is not working, it shows only two images ($ line ['label'] == "other") {} other { } If ($ line ['label'] == "other crawler") {} Else {} if ($ line ['label'] == "other crawler") {} else {}
What is wrong here? Please be a bit new in php / jquery.
Because you need to initialize php tag after
< Code> & lt ;? Php if ($ line ['label'] == "other") {? & Gt; & Lt; Td> & Lt; Img src = "imgb.png" & gt; & Lt; / Td> & Lt ;? Php} and {? & Gt; & Lt; Td> & Lt; Img src = "imgc.png" & gt; & Lt; / Td> & Lt ;? Php}? & Gt;
Comments
Post a Comment