Jump to content


Photo

Missing data after processing.


  • Please log in to reply
3 replies to this topic

#1 Fearpig

Fearpig
  • Members
  • PipPipPip
  • Advanced Member
  • 195 posts

Posted 14 August 2006 - 10:00 AM

Hi Guys,
I could do with some help yet again!

I've written the following code which should list all the members of a deparment in a table with their e-mail address. My problem is that the table is created showing the correct number of lilnes but some of the cells are blank where their names should be.

Here's the code:

<?php

$db = mysql_connect("localhost", "root", "password");

//$id = $_GET['id']; quoted out till I get it working

mysql_select_db("Telephonelist",$db);

$result = mysql_query("SELECT * FROM tbl_telephonenumbers WHERE Department=1",$db);

echo "<table border=1>\n";

echo "<tr><td><B>Name</B></td><td><B>e-Mail</B></tr>\n";
//colum names

while ($myrow = mysql_fetch_array($result)) {

	printf("<tr><td>%s %s</td><td>%s</td></tr>", $myrow["First_Name"], $myrow["Last_Name"], $myrow["e-Mail"]);
		

}

echo "</table>\n";

?>

Any help would be appreciated....
Cheers
Tom.
"Whats wrong with the cat?" - Mrs Schrödinger

#2 Fearpig

Fearpig
  • Members
  • PipPipPip
  • Advanced Member
  • 195 posts

Posted 14 August 2006 - 11:06 AM

#bump#
"Whats wrong with the cat?" - Mrs Schrödinger

#3 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 14 August 2006 - 11:30 AM

If some rows are fully correct, we know your code is fine. So surely the rows with empty cells must be database table rows with missing data.
Legend has it that reading the manual never killed anyone.
My site

#4 Fearpig

Fearpig
  • Members
  • PipPipPip
  • Advanced Member
  • 195 posts

Posted 14 August 2006 - 12:03 PM

Ha.....
You wouldn't believe it! My data import must have failed to MySQL. Have just browsed the data using SQL manager and there's huge chunks missing.

Cheers Andy.

Tom.

"Whats wrong with the cat?" - Mrs Schrödinger




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users