What are you trying to do? The code you got will an accosiative array from the result of the select and put it into $firm... But when you address this array you use numbers. And also.. This code will walk though every singe field in the result and replase all fields that got a value with <br>...
I'm not sure what you are wanting to do but I think this will solve it:
- <?
- while($firm = mysql_fetch_array($cursr)):
- for( $i=0; $i<mysql_num_fields($cursr); $i++)
- {
- if( strcmp($firm[$i],"") == 0 ){
- $firm[$i] = "<br>";
- }
- }
- ?>
I have numbered the lines so you can follow me...
- On like 2 you need to put a ; at the end om the line... Not a :
- Still on line 2.. try using mysql_fetch_row($result); I think that might do what your wanting...
- line 5: I think you have writen wrong here.. Try
if(strcmp($firm[$i],"")
it looks nicer and I that will work..
- If the if statement you wrote works the way it should, you need to write line 6 like this
$firm[$i] .= "<br>";
If this doesn't do the trick for you tell me spesificly what this code is suppose to do and I'll help you further...
Andreas Bernhardsen
Graficonn