primphoto.picture info was lost in PHPadmin?

Hello .My site couldn't display member's photo again. last time i save the photos and check the phpadmin member's information,i can see a number in primphoto and picture. but today many member's information change to 0  ,0 . so they also couldn't display photos in profile too .but have a small photo in profile.don't know why ?

can anyone help me ?

regards

Ling

I asked the arvixe hosting.but they can not help and check .they say my code wrong .but the site never like this on old hosting

Quote · 13 Sep 2009

Does anyone can help me ?

Quote · 14 Sep 2009

well first thing to do is you need to have a backup plan for your site, daily basis backup can save a lot of time when disaster happen. "prevention is better than cure".

second thing to do create a script than would rebuild the PrimPhoto

<?
set_time_limit(0);

if ( !$dblnk )
mysql_connect("localhost","<username>","<password>");

$DB         = "<database>";
$res = mysql_query("select ID,PrimPhoto, NickName from ".$DB.".Profiles $limit");

while ( $arr = mysql_fetch_array($res) )
{
echo "\n $arr[ID] $arr[NickName]";

$res_photo = mysql_query("select * from ".$DB.".media where med_prof_id='$arr[ID]' and med_id='$arr[PrimPhoto]'");
$arr_photo = mysql_fetch_array($res_photo);

if ( (int)$arr_photo[med_id] == 0)
{
$res_photo = mysql_query("select * from ".$DB.".media where med_prof_id='$arr[ID]' LIMIT 1");
$arr_photo = mysql_fetch_array($res_photo);

if ( (int)$arr_photo[med_id] == 0)
{
$sQuery = " UPDATE ".$DB.".Profiles  SET `Picture` = '0' WHERE `ID` = '$arr[ID]' LIMIT 1";
}
else
{  
$sQuery = " UPDATE ".$DB.".Profiles  SET `PrimPhoto` = '$arr_photo[med_id]', `Picture` = '1' WHERE `ID` = '$arr[ID]' LIMIT 1";
}

if (!$restmp=mysql_query( $sQuery  ))
{
echo "\n".mysql_error();
exit;
}

}

}

?>

Live Support http://dolphinbugfixing.com
Quote · 15 Sep 2009

Thank you for your help

would you tell me where i put the primphoto script ?

can you tell me ?

Ling

Quote · 15 Sep 2009

you can put that in your public_html, then open it http://<yoursite.com>/primphoto.php

Live Support http://dolphinbugfixing.com
Quote · 15 Sep 2009

i have saved the code to primphot.php ,then put in public_html/my site . i changed and made the photo work .i checked 10 mins ago. some members' primphoto ,picture number have back to 0 in phpadmin

Quote · 15 Sep 2009

 

i have saved the code to primphot.php ,then put in public_html/my site . i changed and made the photo work .i checked 10 mins ago. some members' primphoto ,picture number have back to 0 in phpadmin

 Did you fix this Ling?

Quote · 9 Nov 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.