Page 1 of 1

echoing records need some help

Posted: Thu Dec 16, 2004 5:40 am
by mohson
Guys I need to put each of my table coloumns into this eco statement but it wont work as the records will appear with quotes around them and if i mess around with it too much then it wont work at all - how would i put in the following coloumns into this statement: salutation, firstname, surname, organisation? please help im stuck. thank you.

Code: Select all

while ($row = mysql_fetch_object($sql)) {

echo "$count. "$row->salutation">$row->firstname<br />\r\n"; // this is example, you may enter here anything you like
$count += 1;
}
?>

Posted: Thu Dec 16, 2004 5:54 am
by Bennettman
Close the string before putting in each call to an object:

Code: Select all

echo $count . '. "' . $row->salutation . '">' . $row->firstname . '<br />' . "\r\n";
etc.

Posted: Thu Dec 16, 2004 6:15 am
by mohson

Code: Select all

echo $count . '. ' . $row->salutation . '' . $row->firstname . '<br />' . "\r\n";
I done what u suggested but took out the extra quote marks because salutation was still appearing with quote marks but now each data item is appearing right next to each other e.g MrAndy what should I do
?>

Posted: Thu Dec 16, 2004 6:43 am
by mohson
NO worries PROBLEM SOLVED cheers