Hi,
I have a sort of latest articles thingy on the front of my website. It gets the article out of a database and then displays everything before the [esum] tag (esum == end summary).
However at the mo it isn't working properly because I can't figure out how I get the latest id from the DB rather than the one I specify.
I.e: I need to be able to do this
Please HelpPHP Code:$latid = "Latest ID NO from the DB"; // Latest ID no
// First Article
// Select the First Article Summary
$article1 = mysql_query("SELECT title, body, id FROM articles WHERE id='$latid'");
// Break up the article variables
$article1 = mysql_fetch_array($article1);
// Start the items
$a1_id = $article1["id"]; // Article ID for link
$a1_title = $article1["title"]; // Article Title
$a1_pre_body = $article1["body"]; // The Article Body (Pre Split)
$a1_body_arrray = split("\[esum]",$a1_pre_body); // Split up the Article
$a1_body = $a1_body_arrray[0]; // Get the first part of the article for summary
$a1_link = "Full Article"; // Get the article link text
![]()
Also, and I know this must be sound dumb but I often get confused about stuff like this.
How do you say and in the WHERE clause of the Select sql query - i.e. SELECT cnt, title FROM articles WHERE id='$latid' and auth='allow' Is that it or is there something different?
Also how do you use the UPDATE query - i.e.
$sql = mysql_query("UPDATE ~~~~~ IN ~~~~~~~~ WHERE id='$id'")
Many Thanks
Rick




)
However, on this occasion, I believe you are correct.
Bookmarks