Hi all I am new to php and i need a little help, I have a webpage which is going to draw all the content from a database were the user can login and amend the values of the field.
Within the database I have two fields id and content. For each row I want an variable such as pageContent1 for the second row pageContent2 and so on.
I have wrote the below code but this does not work can anyone help?
Thank You
Tom
[CODE=php]
// Make a MySQL Connection
mysql_connect(" ###", "###", "###") or die(mysql_error ());
mysql_select_db ("cbags") or die(mysql_error ());
// Get all the data from the "example" table
$result = mysql_query("SE LECT * FROM home_content")
or die(mysql_error ());
$h = 1;
while($row = mysql_fetch_arr ay( $result )) {
$pageContent[$h] = $row['content'];
$h = $h + 1;
}
}
[/CODE]
Within the database I have two fields id and content. For each row I want an variable such as pageContent1 for the second row pageContent2 and so on.
I have wrote the below code but this does not work can anyone help?
Thank You
Tom
[CODE=php]
// Make a MySQL Connection
mysql_connect(" ###", "###", "###") or die(mysql_error ());
mysql_select_db ("cbags") or die(mysql_error ());
// Get all the data from the "example" table
$result = mysql_query("SE LECT * FROM home_content")
or die(mysql_error ());
$h = 1;
while($row = mysql_fetch_arr ay( $result )) {
$pageContent[$h] = $row['content'];
$h = $h + 1;
}
}
[/CODE]
Comment