Deleting Images Associated In Database
I've got a database structure with rows containing filenames of photos on the server each with its own uploader/user and unique id number.
Can someone help me on how to delete an array of photos from the server uploaded by a specified uploader/user?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Uploading And Deleting Images
i am wanting to use a form to upload a jpg image to a directory on my webspage (preferabley using php)i also wantted to use another for to allow deletion of images in the same folder.
Deleting File(images) From Server
I want to be able to delete images I don’t use from my image directory on the server. Deleting images from my Mysql database goes well, but I can’t delete them from server directory. I use this simple function but even the path is right it doesn’t work. Code:
Deleting A Row From A Database
I can't fiqure out why my delete function isn't working. I have a listing of rows in my database with an option to delete an individual row at the end: Code:
Deleting From Sql Database
I have used this script I made to delete files from a server and simultaneously remove information about the file from a database. I have uploaded the same script to a new website and it no longer works. The file does get deleted but the database line doesn't get removed. I can tell where it's going wrong by the error custom error message 'echo'ed on the page ("your file was only partially uploaded"), but I really don't know why.
PHPMyAdmin ... Deleting A Database?
I just want to delete a test database that I made, thats it. There is no upfront obvious way of doing this from my pov so thats why I'm asking.
Deleting Records From Database
I have another question about record deletion from database. For example, my database has 10 records with ids 1 through 10. If I delete id #10 then everything is good and all the records are still 1 through 9. However, if I delete record id #4, then in my db I would have records 1 through 10 with id #4 missing. Is there a command that syncs the database? How do I go about this to keep all the ids in the right order after the deletion? or What do I need to do to prevent that from happenning?
Deleting Comments From Database
i have a message board that enters information to the data base fine, but where i try to create a detele for individual comments, it does not seem to work, any ideas on how to write a delete for this so that it deletes individual messages Code:
Deleting A Table From A MySQL Database
I've looked at the manual and a few other php resources, but yet I couldn't find a simple and easy way to delete a table using php. I noticed there is a destroy() function within the MySQL class, but I'm not sure how it's used.
Deleting Not Working - Flat File Database
I have to decrypt the $email variable in order to delete from a flat file database. I am not sure how to do this... It decrypts it and trims it to display on a select field, but I don't know how to make it delete. Code:
Checking If A Value Is Not In An Array And Deleting Record From Database
I have been trying to figure this one out and have come up against a brick wall although I know it should be relatively simple. I have a form that passes an array to a php script from a multiple select box that is created dynamically. If a user deselects an item then I want to delete the record from the database but am having a big problem with it. The table in the dbase is quite simple with just three fields: id classid formid Basically, the form send through a classid and a formid value and I want to delete any records that have a classid that are not in the form array and have a formid which is passed as a hidden value. I suppose really what I want is to know how to see if a classid is not in the array that is passed.
Deleting Database Rows From An Array Of Variables
I have a form with a list of checkboxes, which are each filled with a date in the format 27012007, for example. The name of each of the checkboxes is the same as the date. Basically when the user presses the submit button I would like all rows in the database table "users" with the corresponding column "date" to be deleted when the form variables date correspond to those in the "date" rows. I think all the checked dates might also need to be put into an array. Would anyone know how to do this?
Images In Database Vs. Image References In Database
i kept all of the uploaded images as files on the server, and created links to them in the database. I have been changing things around now (especially directories) and I am thinking of storing the images in the actual database. I read somewhere that this can be considered a bad practice, so i was wondering what the consensus here was. In my opinion, modifying all of the code to point to the correct directories everytime a page location changes seems like a pain in the a**.
Deleting Duplicate Entries From MySQL Database Table
The topic is related to MySQL database. Suppose a table "address" contains the following records ------------------------------------------------------- | name | address | phone | ------------------------------------------------------- | mr x | 8th lane | 124364 | | mr x | 6th lane | 435783 | | mrs x | 6th lane | 435783 | | mr x | 8th lane | 124364 | ------------------------------------------------------- Quote:
Images In A Database
I had a more barebones version of this script working, but when I tried to put it in with my larger script, it broke. I think the problem lies somewhere in the uploading, but I'm not sure of this. Anyway, here's what I have:
Images And Database
I need an efficient way to store tons of images (just image names, not the file). Then, recored for every 24 hours, an IP address for everyone that has clicked on the LINK to the image. I was thinking Text Files would be a good choice, but I don't know how to go about this.
Images In MySQL Database.
I really do not want to put images in my database, but I want to be able to have a script where users can upload an image, and it will be stored in a database (the file name, name of owner, and the trick performed). Then it will be placed in a gallery.
Batch File Deleting And Folder Deleting
I have a folder in my web site where I used php to create and copy in files. but now I can't delete them easily. The only way I know how that is possible is through php. I get an error the following ftp error: 550 th: Permission denied I had the chmod() set to 0777 on every file and folder. But I still seem to loss control over the files when I try and do things with them through other means. I think it is because the user I use to access the files via ftp a diffrent user. So I tryed to add a function with chown() for the new files I was posting and uploading. It didn't work on those new files. so it looks like the only thing I can do is use the unlink() function which deletes the files fine. The only problem is now I have something like 100 sub directories all with files in them. I need to figure out a way to batch delete them. I can't find a script that goes through and finds all file contents including all sub directories and unlink those things. I found some that will use a for loop to list out the contents of a folder but it is just files. No sub directories. Any body got any ideas on which functions I should use or know where a script is that I can base mine off of. I am not sure how to approach this since what I tryed with chown and chmod has failed thus far. I currently have no code and am starting from scratch on this batch flushing of my directory.
Uploading Images Into A MySQL Database
I am trying to build a page that will upload a file to a MySQL database. I was using the script from the phpbuilder.com web site but alas it is not working. It returns me to the following url: http://www.myhost.com/ /script.php3 Notice the 2 spaces. So I get a 404 and no file is uploaded. has anyone got this to work and if so could I have a look at the code OR if anyone has a script that does the same code i please have a look.
Viewing Images Stored In A Database
I've written this script which is supposed to take an image uploaded by a user and put it in to a database, then at a later date be able to extract the image from the database and display the image to the user. The problem is that whenever I try to display the image, all I get is an error message that the image contains errors. Can anyone tell me where or why these errors might be coming up? Here is my script (I'm pretty sure it's all there):
Using PHP And MYSQL To Select From Database Using Images
I'm trying to update a main page with a list of details matching a selection from a display of images that are displayed in a small window that have been selected from an image group using a select box in the main window, however I don't know how to do this and the main page is not receiving anything when clicking on an image so it's refreshing with empty data. I've seen many many pages giving examples of how to do this with select boxes or how to do this if only one entry uses an image shown in the small window, but the image display window is displaying many different small images not a select box and the database itself has multiple entries that use the same image. Can anyone help? I have a few instant chat programs if someone wishes to discuss this with me in real-time to see what it is I'm trying to achieve.
Storing Images In The Filesystem Versus A Database
Spin-off from How to convert image blob files back to image More often than not you will notice programmers storing the path to an image rather than the file itself as a binary object. A path to the image is often referred to as a file-pointer. It is simply a string-type column in your table that allows you to store the directory path in which the actual image file is stored. Storing the binary data is called a binary large object or BLOB. There are advantages and disadvantages and any discussion on the topic usually stirs lively debate. Debate seems an agressive word, doesn't it? Discussion is much more inviting. Debate is good though, as long as the discussion remains on track and highlights pros and cons, advantages and disadvantages. Let's keep this in mind as we discuss ... Storing Images in the Filesystem Versus a Database As always, there is usually no right or wrong way to program everything. Each application should be analyzed, designed and programmed to the predetermined specification with future growth and enhancement in mind. So what primary areas of concern should we keep in mind when dealing with image storage and management in a web application? I'll start with a few and hopefully others can offer more ... Performance Storage Portability Performance The biggest advantage to storing a file-pointer as opposed to the binary data in a database table is speed. Period. And I'm not just talking about database-retrieval speed here so let's clarify that first. It should be quite obvious that reading from a table containing mere text as opposed to large binary objects is going to be faster. This issue can be circumvented in binary storage solutions by keeping the actual BLOB column in a table all by itself with a foreign-key relationship to the other tables -- no need to be reading this table into memory when all I really want is the end result, the image itself, right? Right. But, even after that we have to read that column's binary data from the database and then push it out to the browser. In my experience, allowing the HTTP server to retrieve an image from the filesystem versus reading binary data from the database table has always been faster. If you have a setup that proves this wrong you are going to have to share it here because I would truly love to learn from you. Storage The database is going to be a fraction of the size when using file-pointers as opposed to BLOBs but the filesystem is going to be the same either way. Security and Disaster Recovery? You can secure, backup and restore directories and databases equally when structured correctly. A well-designed application and well-designed database structure within that application (which is stating the same thing if you ask me) makes the difference. You are going to incur the Hard Disk Drive (HDD) storage somewhere whether it is in the filesystem or the database. That much can be agreed upon. Portability If and when I need to port my appication and/or the data along with it, how well does it lend itself to portability? BLOB solutions make this pretty easy. Just move the database. But the same can be said for file-pointers if you store them correctly. The biggest key to storing the path though is how you store the path. For Windows users you can save the file's Universal Naming Convention (UNC) instead of the actual disk location (such as path oimagesexample.jpg instead of c:imagesexample.jpg). Other filesystems have lots of ways to overcome this minor limitation (symbolic links, samba shares, etc.). This is quite helpful when it comes to application portability. Summary The original question that prompted this topic was something along the lines of "Would I be designing it wrong if I stored the path in the database rather than storing the image itself?" to which I would reply no, you can do it that way, but do you want to? Hopefully this discussion will take off and others will offer valuable input.
How To Upload Multiple Images To A Mysql Database?
ive been looking for a tutorial or a snippet of code that would allow me to go to a browse button, navigate to a directory, and either upload everything in that directory or let me select what ones to upload, all i have been able to find are multiple inputs and each image needs to be uploaded individually.. Anyone seen anything like this before?
Deleting From Database, "SQL Sytax Error"
I searched the forums and I couldn't come up with anything, so I'm sorry if this has been solved before. But my problem is that when I want to delete a comment from the database, it just says, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1". At line one I have a Session_start...and I doubt that would interfere with deleting. Here's my query: $com = $_GET['del']; if ($com != NULL && is_numeric($com)) { if ($ip == $okip) { mysql_query("DELETE FROM `comments` WHERE `id` = '".$com."' LIMIT 1 "); echo "Comment has been deleted.<META HTTP-EQUIV="REFRESH" CONTENT="2; URL=show.php"> "; } else { echo "You do not have permission to delete comments."; } }
Developing A Page That Displays Latest 5 Images In A Database
I am currently changing my web site so that it is PHP and mySQL powered. On the front page I have an area that will display the latest images in my portfolio and the latest text description. Therefore, what I need is an admin page which allows me to upload images to a database which has a timestamp/date field, a thumbnail field, an image field, a text field for the title and a text field for the description. I also need a HTML form with inputs for the thumbnail upload, image upload, title and text description (in a textarea). It would also be useful to have the page display the database contents and allow me to edit the details and also, delete rows. I then need code for that will display the most recent 5 thumbnails and the title on my index.php page.
Stamps/inserts Small Images (logos) Onto Larger Images.
It may be called image stamping or water marking but im not sure. Basically i want a script that prints/stamps a smaller image onto a larger one, the smaller mage being a logo. This will make it harder for people to steal my pictures as they will have my logo on them. An example of this is with ebay, when you submit a picture of the item your selling ebay will printe a small logo in the bottom right corner of the picture. Could anyone suggest a script for this, just a simple one then i can mess around with it and make it better.
Stamps/inserts Small Images (logos) Onto Larger Images.
It may be called image stamping or water marking but im not sure. Basically i want a script that prints/stamps a smaller image onto a larger one, the smaller mage being a logo. This will make it harder for people to steal my pictures as they will have my logo on them. An example of this is with ebay, when you submit a picture of the item your selling ebay will printe a small logo in the bottom right corner of the picture. Could anyone suggest a script for this, just a simple one then i can mess around with it and make it better.
Random Images From Google Images
I am trying to set up a page that will show a random image of something on a web page (e.g. cats) taken from a random Google Image. I can't find any sample code to do this. Can someone point me to an example?
Deleting
how could i delete everything from a table in a mysql db except for the 10 latest things ?
Deleting All Files
Is it possible to delete all files in a folder using unlink() or something similar?
Deleting The Saved Db The One Before?
I made a script that backups the database as sql file in the server. I mean script writes it into the harddrive, but everytime when i execute the script the harddrive loss another 3 mb. How can i modify the script to delete the one before when i execute it to write the new one?
Need Help With Deleting Records
I'm trying to add a link on the display of a record to delete that record. The main part of the record is stored in pw_event, then there are several rating fields for that record stored in pw_rate, and there is also several records for the first record stored in pw_whois. I need to have a link that will deleted everything for that record in all three tables. Here is my display script: PHP Code:
Deleting Last Comma
The code below displays pet names like so: Fido, Bowser, Kittycat, Spot, and I want to delete only the last comma. I tried 'substr' and 'rtrim' and both of those delete the space and comma between each name, not just the last name as I'd like, so I end up with: Fido,Bowser,Kittycat,Spot, How would I delete only the last comma, so that it is this instead? Fido, Bowser, Kittycat, Spot Even with trim and substr, I end up with:
Deleting A Session
I want to be able to delete a session so that the next time there's a call to session_start, it creates a new session ID. I don't want to destroy the session variables specifically (though this will be a side-effect of what I'm doing) so I know that session_destroy isn't what I want to do. I presume I should just delete the session cookie manually. Is there a neater way? And if not, how do I do this?
Deleting A Director
I'm using this code trying to make ato delete a file or folder under w2k, apache. $direct=split("repadmin.php",$PATH_TRANSLATED); $file=$direct[0].$filedeleted; $filesys = eregi_replace("/","",$file); $delete = @chmod ($filesys, 0775); unlink("$delete"); header("Location:repadmin.php"); exit; but return this warning: Warning: unlink(1) [function.unlink]: No such file or directory in c:program filesapache groupapachehtdocsguonline epositorio epadmin.php on line 94 I checked the whole path and looks good.
Deleting Files
The below should delete files from a dir older than a week. I set the $dtime to 0 to test the script but it deletes nothing. What is wrong? Code:
Deleting Files
I'm using different files to store some arrays to make administration of a very small job-logger very easy. I currently read the file, remove the element to be deleted, delete the whole file, and write the file again without that element. Is there a way to remove a single element out of that file without deleting the whole file?
Deleting A Line
how do i delete from a text file 1 of the following lines jon|scott adam|smith <--delete paul|clark say i would like to delete the middle line of this txt, in member.txt what php code or logic would help me accomplish this? Also i am clicking on a hyperlink that is keeping count of the entries i have made. e.g php?record_id =1 php?record_id =2
Deleting A Record.
One last (hopefullly) problem I can't seem to get around for this program...why isn't this deleting the row i want? It does nothing. Now error messages either. HELP! $link = mysql_connect("localhost"); if(! $link) die("Could not connect to MySQL"); $database = "PC_Store"; mysql_select_db($database) or die ("could not open $database: ".mysql_error() ); $result = mysql_query("DELETE FROM inventorydata VALUES('$ProductID')"); The $ProductID variable is brought in from a menu choice on a diffrent page, it is also the primary of the table...so it should delete the whole row right?
Deleting Records
I've been trying to delete records since a week and i'm not able to do it. Before with this script, i was doing so many things at a time and i was confused.But, now, i just displaying the records from a table N trying to delete them.Would somebody pls guide me. I just wanna set the delete flag(i.e, i want to set the RBS_DELETE column to Y or something) when i check a check box to delete it. I've some 5 records displaying on my form and i want to check 3 of them and when i check them and hit submit, i want the RBS_DELETE column to have some value. PHP Code:
Deleting A Message
I want a button to delete each message in you inbox wen clicked. im using this that doesn't work, because i coded it Code:
Cookie Not Deleting
login.php: setcookie('id', $userinfo['id'], time()+60*60*24*31*3 , '/'); logout.php: setcookie('id', '', time()-60*60*24*2); Any idea why it is not deleting my cookie?
Deleting Posts
How can I delete my previous post? It's showing up in Google when I search for the url referenced in my previous post (if I put the name here, it will show this post, too). If I can't delete it, can I make it so that Google can't pick it up?
Deleting Files
I'm trying to modify this script to remove files that end with %enlarged.jpg or %enlarged.gif or %enlarged.png, can someone help with the if statement, I've tried several things, of which, nothing is working: Code:
|