Two questions: Extract Images & Searching a server
Posted: Thu 09 Aug 2007 07:52
Hello, i'm building an application using MySQL DAC Standard edition and i have "two problems":
The first, i'm trying to looking for a MySQL server in a intranet using an user that is created for this, for example: The DBA creates an user: 'db', password: 'db' and a thread or a process explore all the range of the private net class C ( 192.168.x.x ). If any connection has a success ( MyConnection->Connected == true ), The IP was found in the intranet. So i do MyConnection->Connect() with this parameters, but i put the timeout low to not take several seconds trying connect. When i proof this method, my application was so slowing so i don't know another tactic / method or another parameter for MyConnection to bring it more fast. Any solution?
The second problem is using PHP. I store Images as BMP images Using parameteres in a SQL statement ( INSERT INTO ..... VALUES (...., :image, .... );
MyConsulta->ParamByName("image")->AsBlobRef->LoadFromFile("C:\temp.bmp");
That's right.
When i try to recover this image using PHP, appear strange characters:
#+f�%2j�->o�-Aq�g�f�e�c�b�^�\�Z�W�Y�Z�`�d�c�a�_�\�
In my web browser, so i don't know where is the problem.
The PHP code is the following:
Thanks a lot!
The first, i'm trying to looking for a MySQL server in a intranet using an user that is created for this, for example: The DBA creates an user: 'db', password: 'db' and a thread or a process explore all the range of the private net class C ( 192.168.x.x ). If any connection has a success ( MyConnection->Connected == true ), The IP was found in the intranet. So i do MyConnection->Connect() with this parameters, but i put the timeout low to not take several seconds trying connect. When i proof this method, my application was so slowing so i don't know another tactic / method or another parameter for MyConnection to bring it more fast. Any solution?
The second problem is using PHP. I store Images as BMP images Using parameteres in a SQL statement ( INSERT INTO ..... VALUES (...., :image, .... );
MyConsulta->ParamByName("image")->AsBlobRef->LoadFromFile("C:\temp.bmp");
That's right.
When i try to recover this image using PHP, appear strange characters:
#+f�%2j�->o�-Aq�g�f�e�c�b�^�\�Z�W�Y�Z�`�d�c�a�_�\�
In my web browser, so i don't know where is the problem.
The PHP code is the following:
Code: Select all
$result = mysql_query("SELECT photo FROM person WHERE IDC = 111111");
$result_array = mysql_fetch_array($result);
header("Content-Type: image/bmp");
echo $result_array[0];