$result2 = mysql_query("SELECT * FROM image_upload");

                $data2 = mysql_fetch_array($result2);

                if($image_width > $data2['maxwidth'] || $image_height > $data2['maxheight'])
                    echo '<br>'."Image is too big".'<br>';
                    echo $image_width.'>'.$data2['maxwidth_bn'].'<br>';
                    echo $image_height.'>'.$data2['maxheight_bn'];

Successfully upload pictures
Image is too big

I wonder why the message says the image is too big?

Your IF statement checks against maxwidth and maxheight but you output maxheight_bn and maxwidth_bn. How do you know they're the same?
As the code in the loop is firing either the width or the height is greater than maxwidth or maxheight.

I try this:

$image_info = getimagesize($_FILES["file"]["name"]);
                $image_width = $image_info[0];
                $image_height = $image_info[1];

I am trying to see the result of $image_width, yet I do not see the result.

I wonder why?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.