Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

PHP Help?

Name: PHP/Fail 2008-07-19 12:58

Could somebody please help me, I'm learning PHP at the moment and there seems to be a slight failure with MySQL:

<?php
(some code has been skipped, such as passwords and db names)
$csn = mysqli_connect($host,$user,$password,$dbname)
    or die("Could not connect to sever.");

/* This query finds the limits of the post list */
    $query = "SELECT MIN(postID) FROM first_post";
    $result = mysqli_query($csn,$query)
        or die("Couldn't retrieve post limit.");
    $postmin = mysqli_fetch_assoc($result);
/* Continueing */
    $query = "SELECT MAX(postID) FROM first_post";
    $result = mysqli_query($csn,$query)
        or die("Couldn't retrieve post limit.");
    $postmax = mysqli_fetch_assoc($result);

mysqli_close($csn);

echo "Max: ";
echo $postmax['postID'];
echo "Min:";
echo $postmin['postID'];
echo "\n";
?>

The output for this is Max: Min: and not showing the arrays :-\
HALP?

Name: Anonymous 2008-07-19 15:24

>>4
SELECT MAX(habeeb) as habeeb FROM ....

now you can acces your array with $postmax['habeeb']

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List