remove uploaded data from database and files from server

Hello,

(Using cmsb 2.13 and membership 1.06)

Is any way to remove selected images from the database?

i listed my section like:

list($accomRecords, $accomMetaData) = getRecords(array(
'tableName' => 'accoms',
'where' => "owner='".mysql_escape(@$CURRENT_USER['num'])."'",
'allowSearch' => false,
'loadUploads' => true,
// 'debugSql' => true,
));
$accomRecord = @$accomRecords[0];
// showme($accomRecord);


and displayed the items like:

<?php foreach ($accomRecord['acc_photos'] as $upload): ?>
<li>
<a href="<?php echo $upload['urlPath'] ?>" rel="prettyPhoto">
<img src="<?php echo $upload['thumbUrlPath'] ?>">
</a>
<ul class="action-list">
<li>
Actions
</li>
<li>
<a href="<?php echo $upload['urlPath'] ?>" rel="prettyPhoto">view</a>
</li>
<li>
<a href="#">delete</a>
</li>
</ul>
</li>
<?php endforeach ?>


how can i trigger and delete selected images from the 'uploads' table and remove the files from the server?

i found only very few posts in the forum about this very important part and nowhere the right answer.

Please advise,
Karls

Re: [Jason] remove uploaded data from database and files from server

Hello Jason!

Thank you for your quick response and solution!

Another one with the same picture gallery.
Side by the pictures i put text input to get information (titles) for the images from the users.
How can i update the uploads table with these array information?
Can i create $query for each record to update the info1?

Please advise,
Karls

Re: [ht1080z] remove uploaded data from database and files from server

By Jason - December 20, 2011

Hi,

Yes, if you can create a MySQL UPDATE query for any given record, using that records num field as a unique identifier.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/