At 7:46 +1300 2/9/02, Barry Rumsey wrote:
>I am trying to do a simple fetch of the lastest add name. I have the
>following code :
>$query = "SELECT name FROM name ORDER BY name DESC LIMIT 1";
>$latename = mysql_query($query) or die("Select Failed!");
>$latename = mysql_fetch_array($latename);
>echo "<b>Lastest Name Added:</b>  $latename    "
>I know I am doing something wrong as being new to php it get be confused.
>It returns : Lastest Name Added: Array
>Could someone please point out where i'm going wrong

You've fetched an array, and you're trying to print the array itself,
not a member of the array.

Perhaps you want:

echo "<b>Lastest Name Added:</b>  $latename[name]    "


echo "<b>Lastest Name Added:</b>  $latename[0]    "

I suppose you might also mean "Latest" rather than "Lastest"... :-)

>Thank you

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to