Hi again,
Why wont this script show the content row from the page_data table?
CREATE TABLE page_data (
id tinyint(4) NOT NULL auto_increment,
page text,
content text,
PRIMARY KEY (id),
UNIQUE KEY id (id)
) TYPE=MyISAM;
INSERT INTO page_data VALUES (1, 'homepage', 'text for homepage');
INSERT INTO page_data VALUES (2, 'homepage full version', 'homepage full version text');
INSERT INTO page_data VALUES (3, 'questions', 'questions text');
INSERT INTO page_data VALUES (4, 'dates', 'dates text');
INSERT INTO page_data VALUES (5, 'what they are saying', 'what they are saying text');
<?php
// connect to the database
$dbh=mysql_connect ("localhost", "transitc_content", "content")
or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("transitc_content");
$result = mysql_query("SELECT id, page FROM page_data");
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
printf ("page id: %s<br> page name: %s <br> page text: %s<br><br>", $row[0], $row[1], $row[2]);
}
?>
I was thinking that the $row[2] and the third %s would be responsible for ensuring the output of what is contained in the content column....😕
Thanks!