This is how I think you would have to do it then:
1) Upload the pic
2) Return the pic in a page which actually displays in a browser, and then uses JavaScript to find out the proportions, then submits itself to another PHP form which places the image dimensions into the row.
So... have the form which you use to upload the pic to the database as normal.
Then your upload script would look something like this:
<?php
if (!$pic){
// they have not selected a pic to upload
} else {
// put the actual uploading bits here
// you are going to have to get the primary key back for the image just uploaded
// store it as $pkey or something
//now we make the next page that gets the dimensions, and submits them
?>
<html>
<head>
<title>Processing...</title>
<script language="JavaScript">
<!--
function getDims() {
var picwidth = document.images[0].width;
var picheight = document.images[0].height;
var varstring = "picwidth=" + picwidth + "&picheight=" + picheight + "&pkey="<?php echo $pkey; ?>";
document.location = "submitdims.php?" + varstring;
}
-->
</script>
</head>
<body onload="getDims()">
<img src="picture.php?id=<?php echo $pkey; ?>">
</body>
</html>
<?php
}
?>
Then you need to have submitdims.php which just has sometyhing like this (plus all your connection info!) :
$sql = "UPDATE pics SET picwidth='$picwidth',picheight='$picheight' WHERE picid='$pkey'";
$result = mysql_query($sql);
Umm... Ok?
Hopefully you can follow this 🙂