$q1 = "insert into tablename (images) values ($imageSavingResult)";
mysql_query($q1);
you just have to change the name of the table, and if you have a user ID yo need to indicate the id into the insert. Remember to connect to your db first.
Sorry for my english, i talk in spanish.
Muy bien gracias, Yo hablo espaņol tambien. Yo tome una ruta diferente para guardar las imagenes en la base de datos. Utilizo la funcion encontrada en saved.php para buscar el valor de $images y salvarlo finalmente en la base de datos.
I know you have been busy. Please help me out with one last request. This about the preview images: Under every upload input a preview image appears. Is there a way I can have a second copy of the preview images appear somewhere else in the page but not with an upload input above? Hope this makes sense.
Here I place a function to update uploaded images with no loop.
It takes two arrays, one with the images comming from the form (which may contain some changes or not) and one with the images stored in database.
This two arrays are substracted in both ways, in order to get the new and the deleted images, which are set in the arrays $deletedUploads and $newUploads.
A last array, $totalUploads, gets the list of total stored images. You may return this array instead of $result, or pass it by reference as parameter. It is not used in this function for any purpose, if you don't need this array for anything, you may remove it from the function.
I use this code and works perfect, but i have a problem, for any reason the pics on the folders won't delete, only delete the names of db. I appreciate your help.
I use this code and works perfect, but i have a problem, for any reason the pics on the folders won't delete, only delete the names of db. I appreciate your help.
Thanks!!!
You have to pay special attention to the UploadedFile::deleteUploadedFiles() function.
I guess it'll be a question of rights. Check if you have delete rights for the image directory.
Hi AMS! Well, i found the solution for non deleted files, in the function deleteUploadedFiles. Is necesary to remove "$resultOk = $resultOk &&" before self::deleteUploadedFile($filename); and work it!
But now i cant found a solution in configuration.php functions for the images path.
PHP Code:
public static function deleteUploadedFiles($filenames) {
$resultOk = true;
foreach($filenames as $filename) { if ($filename) { $resultOk = $resultOk && self::deleteUploadedFile($filename); } } return $resultOk; }
Great script AMS, exactly what I was looking for from weeks.
Just a request: is it possible to show the file name somewhere after selected the image? The most annoying issue in all upload image forms is that the long path to picture in the input area always hide the file name: you have to scroll the path to the right to check the filename.
One more thing: if I remove a selected image not yet saved, the path still stay in the input field, could it be removed?
Hi AMS! Now i have the form fully working and i add a form validator, but i have the last question. It is posibble to send the form without images? in my form the images are optional. I remove the "length" line in itemform.js - function validateData() - if (( ! $.uploaderPreviewer.loadedImages().length) and now i can send the form without images but i cant remove the alert message of no images added. Can you say me how to remove this alert message?
Many thanks for this script, is perfect but only have one problem. The script dont work with form, if i use a <form></form> when i press submit button don´t save the content. Any idea for me, how to repair? Is necesary a <form> to validate data.
Does anybody can solve Tom's question?
Script is really great but it would be more great to use it with common <form></form> tags.
Or please describe how to make a full-sized form with several fields using script's workaround.
In its initial state there is only one "Other field:" which is transferring through GET request.
Regards
Originally Posted by TomTom3
Hello AMS!!!
Many thanks for this script, is perfect but only have one problem. The script dont work with form, if i use a <form></form> when i press submit button donīt save the content. Any idea for me, how to repair? Is necesary a <form> to validate data.
Bookmarks