Hi,
I want to write a PHP template with a variable number of the last
recordset in a MySQL DB being the number referenced in the file. This is
so my file can be saved as a PHP page looking at the right content in a
database for a content management system. I am stuck on the way to do
it. The code below is the part I want to change:
So I need to do two things:
1) Select the last record in a database table.
2) get PHP to write all the code below on the fly.
////////////////////////
db_connect();
// This is the query number which needs to be changed and written every
time as the last record in the DB
$query = "select * from crm_content where PageID='1'";
$result = mysql_query($query) or die("Error: Query failure
with<BR>$query<BR>".mysql_error());
while ($array = mysql_fetch_array($result))
{
$PageTitle = "{$array["Title"]}";
$BodyText = "{$array["BodyText"]}";
$Picture1 = "{$array["PictureOne"]}";
$Picture2 = "{$array["PictureTwo"]}";
$CatID = "{$array["CatID"]}";
}
// then write the function to call the page here
//////////////////////
Any ideas thoughts or help much appreciated.
Steve Jackson
Web Development and Marketing Manager
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php