I have a real funny one I call a batch of records from the DB and I don't know why it always misses the first record?? any ideas.... (code below) $x = 0; $sql = "select * from interest where Number = \"$cid\" "; $data = mysql_query($sql)or die("Couldn't execute query"); $result = mysql_fetch_array( $data ); while($result = mysql_fetch_array( $data )) { if($x % 2 == 0) { $bg = "#ffffcf"; } else { $bg = "#ffffff"; } echo "<tr bgcolor=$bg class=row ><td width='120'>"; echo $result['Name']; echo "</td><td >"; echo $result['Locality']; echo "</td><td width='100'>"; echo $result['County']; echo "</td><td width='80'>"; echo $result['Period']; echo "</td>"; echo "</tr>"; $x ++; }
What exactly do you mean, its not catching 'name', maybe its not called 'name' or name is in another table ?
You're not gunna want to put php tags inside other php tags, but you definately need quotes around the tag information: echo "<tr classs='row' bgcolor='{$bg}'><td width='120'>"; PHP: As far as missing the first row goes, the only reason it wouldn't display is if the it doesn't match the Number=$cid. Also, it shouldn't make a difference because your backslashes do the same thing, but try this as your sql statement: $sql = "SELECT * FROM interest WHERE Number='{$cid}'"; PHP: