This topic is locked
[SOLVED]

  Blob image problem (again)

2/16/2012 11:46:49 PM
PHPRunner General questions
S
Sergej author

No matter what i do - i keep getting broken image icon instead of picture on my custom view page...all other text data is displayed as it should be and where should be...and the pictures are correctly displayed on list/edit pages generated by phprunner...

here is the snippet from my page
<?php

$sql = "SELECT picture FROM Individual_profiles WHERE UserID= '".$_SESSION["id"]."' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo "<img src=\"imager.php?table=Individual_profiles&field=picture&key1='".$data["UserID"]."'\">";

echo $data["UserID"];

?>

Where Individual_profiles is the table name

picture and UserID are fields from that table

UserID is one of the key column set in phprunner
Is there anything more i should do...to have picture displayed?

Thank you all

C
cgphp 2/17/2012

UserID is not a selected field in the query, and picture is not fetched in the echo statement. Not sure what you want to do.

S
Sergej author 2/17/2012



UserID is not a selected field in the query, and picture is not fetched in the echo statement. Not sure what you want to do.



Hi, Cristian,

I'm trying to create custom personal page for each logged user. It works fine with txt data, but i'm not able to pull out precise blob picture for each user - i'm not able to pull any picture whatsoever just broken image gif...

Admin 2/17/2012

Your code doesn't make much sense as you reference variables that are not defined anywhere like $_SESSION["id"] and $data["UserID"].
If UserID field serves as both key column of Individual_profiles table and also stores username you can use the following code

echo "<img src=\"imager.php?table=Individual_profiles&field=picture&key1='".$_SESSION["UserID"]."'\">";


If this is not the case - you have to show us the whole structure of Individual_profiles and explain what's the key column, where image is stored and what fields are used to store username and password.

S
Sergej author 2/17/2012

[quote name='admin' date='17 February 2012 - 03:13 PM' timestamp='1329488026' post='64375']

Your code doesn't make much sense as you reference variables that are not defined anywhere like $_SESSION["id"] and $data["UserID"].
If UserID field serves as both key column of Individual_profiles table and also stores username you can use the following code

echo "<img src=\"imager.php?table=Individual_profiles&field=picture&key1='".$_SESSION["UserID"]."'\">";


If this is not the case - you have to show us the whole structure of Individual_profiles and explain what's the key column, where image is stored and what fields are used to store username and password.

[

Thank you, admin...I'll try to explain...i have created external html page and added php snippets - with all include libraries there are...and inside the project - after login - i defined all session variables - among them even $_Session (id)! In individual_profiles table - UserID is automatically filled on adding data depending on the value of $_Session["id"] - and UserID is key column there.

here is the code on the page - and it pulls appropriate data for all the users logged exept the photo - if there is no photo it echoes correctly defined line, but if there is photo only broken image link is displayed...
<?php

$sql = "SELECT picture, UserID FROM Individual_profiles WHERE UserID= '".$_SESSION["id"]."' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

if (empty($data["picture"])) {

echo "No photo available!";

}

else

{

echo "<img src=\"imager.php?table=Individual_profiles&field=picture&key1='".$data["UserID"]."'\">";

}
echo "
";

echo $data["UserID"];

?>

</td>

</tr>

<tr>

<td width="280"><span class="text"><br />

Item 1</span></td>

</tr>

<tr>

<td width="280"><span class="text">Item 2</span></td>

</tr>

<tr>

<td width="280"><span class="text">Item 3</span></td>

</tr>

</table></td>

<td width="663" align="left" valign="top"><p class="latestnews">&nbsp;</p>

<p class="latestnews">Profile Information</p>

<table width="600" border="0" cellpadding="0" cellspacing="2">

<tr>

<td width="190" align="right" valign="top"><span class="text">About me:</span></td>

<td width="411" align="left" valign="top" bgcolor="#CCCCCC"><p class="textWhite">

<?php

$sql = "SELECT aboutme FROM Individual_profiles WHERE UserID= '".$_SESSION["id"]."' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo $data["aboutme"];

?>

</p></td>

</tr>

<tr>

<td align="right" valign="top"><span class="text">Skills:</span></td>

<td width="411" align="left" valign="top" bgcolor="#CCCCCC"><p><span class="textWhite">

<?php

$sql = "SELECT skills FROM Individual_profiles WHERE UserID= '".$_SESSION["id"]."' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo $data["skills"];

?>

</span></p></td>

</tr>

<tr>

<td align="right" valign="top"><span class="text">Working experience(Years):</span></td>

<td width="411" align="left" valign="top" bgcolor="#CCCCCC"><p><span class="textWhite">

<?php

$sql = "SELECT Workingexperience_Years FROM Individual_profiles WHERE UserID= '".$_SESSION["id"]."' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo $data["Workingexperience_Years"];

?>

</span></p></td>

</tr>

<tr>

<td align="right" valign="top"><span class="text">e-mail:</span></td>

<td width="411" align="left" valign="top" bgcolor="#CCCCCC"><p> <?php

$sql = "SELECT email FROM TCIUsers WHERE id= '".$_SESSION["id"]."' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo "<a href=\"mailto:".$data["email"]."\">".$data["email"]."</a>";

?>
</p>
<?php

include("include/dbcommon2.php");

include('include/xtempl.php');

include('classes/runnerpage.php');

include('classes/listpage.php');

include("classes/searchpanel.php");

include("classes/searchcontrol.php");

include("classes/searchclause.php");

include("classes/panelsearchcontrol.php");

?>

Admin 2/17/2012

Try to print $data["UserID"] on the web page and then open in browser the following URL:

imager.php?table=Individual_profiles&field=picture&key1=<user id here>


Probably this can tell you what exactly goes wrong.

S
Sergej author 2/17/2012



Try to print $data["UserID"] on the web page and then open in browser the following URL:

imager.php?table=Individual_profiles&field=picture&key1=<user id here>


Probably this can tell you what exactly goes wrong.



i get the correct user id - 9

but when copy pasting your link - got just broken image gif the same as on web page...

Admin 2/17/2012

Sergej,
if you have a support contract post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program. We'll be glad to assist.

S
Sergej author 2/17/2012



Sergej,
if you have a support contract post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program. We'll be glad to assist.



not sure if i have it anymore...only if buying all the templates today counts as an extension...thnx nevertheless

Admin 2/17/2012

Post it anyway, we'll help you.

S
Sergej author 2/18/2012

Dear Sergey - i posted the whole pproject i'm working on

thank you for your kindness

Admin 2/20/2012

Make sure you open a ticket sending your demo account URL. Until you do so we don't know where to look and how to reproduce the issue.

S
Sergej author 2/22/2012



Make sure you open a ticket sending your demo account URL. Until you do so we don't know where to look and how to reproduce the issue.



Thank you Sergey, but i maanged somehow to solve my problems with blob images everything is working fine now...

thank you for your kind offer.

Most appreciated.

Best