getimagesize & Mysql class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!


When i run the following code, mysql_error() = "No Database Selected" and
mysql_errno() is "1046".

After nearly going insane, I realised through trial and error that if i
commented out the call to getimagesize() and fed the DB class with some data
of my own, it all worked perfectly.

I also placed a call to  $db->getDbName() in the code (not visible below)
and it provided a db name, which was odd since it says there was "No
Database Selected".

The db class has not failed anywhere else in my code. The error seems to
occur only if the db class is used following use of getimagesize()

I also managed to update the Mysql db without using a class. So, there
appears to be nothing wrong with my class, because it works elsewhere, but
it also appears that invoking MYSQL commands through a class after a call to
getimagesize() does not work.


Surely millions of users use a db class to update a db with image dimensions
etc!?



TIA


Malcolm



Should you need to look at classes in use, please view at
ftp://sawds.dsvr.co.uk/general/


<?
require_once("../class_MysqlDb.php");


$img_attrib = getimagesize('images/piki.jpg');

$img_width = $img_attrib[0];
$img_height = $img_attrib[1];


$db = new MysqlDb();
//echo mysql_error()."<p>".mysql_errno();exit;
$result = $db->query("
		UPDATE page SET
		page_img_width = \"$img_width\",
		page_img_height = \"$img_height\"

		");



if(!$result) echo mysql_error()."<p>".mysql_errno();exit;
$db->closedbConnection();


?>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux