Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


Advertisements:




SuperbHosting.net & Arvixe.com have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for BigResource.com.







Delete


In one part of a review site i am making it allows top level users to make reviews witch includes uploading a picture and then changing the name to [name of review].[whatever], also it allows people to edit the review and change the picture, how exactly would i go about getting rid of the old picture so that i dont have to do hours of clean up.


View 2 Replies (Posted: April 17, 2007, 12:37:04 PM)

Sponsored Links:

Related Forum Messages:
Delete Record - When The Delete Link Is Clicked The Next Page Is Blank And Nothing Is Deleted.
This is my "delete.php" and this "todo/delete.php?id=64" an example of a link to it generated from the index.php page. When the delete link is clicked the next page is blank and nothing is deleted. What have I done wrong?

<?
include("dbinfo.inc.php");

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$id="delete from todo where id='$id'";
mysql_query($id);

mysql_close();
?>

Posted: 6:29 pm on Mar. 26, 2005

View 1 Replies!   View Related
Doctrine Cascade:[delete] Does Not Call Delete() Method Of Related Objects?
using Doctrine 1.2 in my project.The schema.yml file contains:

Campaign:
tableName: campaign
actAs:

[code]...

I have defined CampaignImages::delete() method and put some debugging code there, but it does not get executed when Campaign::delete() is called.Isn't cascade:[delete] meant precisly for this reason?I don't want to use database level cascades, because image files associated with CampaignImage must be deleted when deleting record.

Posted: Jul 13 10 at 10:12

View 3 Replies!   View Related
Use Unlink Function To Delete File During Update And Delete In Joomla?
I am able to upload file in joomla. I want to know if the user is updating images with another image like then the file already present and linked with user id should be replaced or deleted. In case of delete function should be removed.

$src = $file ['tmp_name'];
$dest = JPATH_COMPONENT . DS . "uploads" . DS . $newfilename;
JFile::upload ( $src, $dest );
// update the field greeting_pic //
$result = $model->updateGreetingPic ( $id, $newfilename );

I want to replace the uploaded image if present and replace it with the new one. How do I fetch the already uploaded image from the database (MySQL).

Posted: Jul 14 at 9:00

View 1 Replies!   View Related
Mysql Delete - $query = Mysql_query("DELETE
how would i do the following ?

$query = mysql_query("DELETE notes, datestamp, abs_value, ID FROM absence_mgt  WHERE datestamp='$date' AND ID='$vtc_login' ") or die(mysql_error());
im just getting "Unknown table 'notes' in MULTI DELETE" ?

Posted: March 28, 2007, 05:42:37 AM

View 9 Replies!   View Related
MySQL Delete Return / Check If Delete Was Successful?
Using PHP, I am trying to delete a record, but I want to check if it was successful or not. Is anything returned from a successful DELETE FROM foo where bar = 'stuff'?

Alternatively, do you know any other ways to check if a DELETE was successful? Or am I better off just making sure the row exists before I delete it? I am trying to avoid another query if possible.

Posted: May 28 09 at 18:11

View 3 Replies!   View Related
Delete Row From Database / After 15 Days The Post Will Be Delete Automatically?
I had a real estate web site and user/visitor can post their property into the database. Now What I need is After 15 days the post will be delete automatically"How to do delete using Date ?"

Posted: Mar 3rd, 2009

View 4 Replies!   View Related
How To Browser Delete Session Or Delete History Works
Let a user using Mozilla browser, On three tabs he login to his yahoo account ,gmail and hotmail. Now if we Clear Recent History, all three session will be cleared. But at the same time if there is another session in any another browser it will not be cleared.

So What i am trying to ask here is , the cookies and session related details ,browser cache will be in the local computer and it will be cleared on clearing history. But is it browser specific? The cookie and all will have any browser specific id , how it will differentiate that now clear the IE history or clear chrome history.

Posted: May 1 at 18:35

View 2 Replies!   View Related
Script Add And Delete Data To The Database - Add It Correctly But It's Not Able To Delete It?
This script add and delete data to the database, it add it correctly but it's not able to delete it.

<?php
require 'include/db.inc.php';
$db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or
    die ('Unable to connect. Check your connection parameters.');[code].....

Posted: October 26, 2010, 11:54:46 AM

View 4 Replies!   View Related
Delete Database Row Through Delete Button In Html Page
I just made a php function

function deletebooking($orderID){
$sql="DELETE FROM bs_reservations WHERE id='".$orderID."'";
$result=mysql_query($sql) or die("oopsy, error when tryin to delete events 2");
}

I have a .php file which process a submitted form and then displays a HTML page. How do i add a delete booking button which calls the above function to the HTML page. The $orderID variable is already set.

Posted: May 4 at 3:33

View 3 Replies!   View Related
Delete Flickr Photo Through Delete Permission?
I want to delete a photo from flickr application with delete permission but i am confused how to use delete permission, anyone suggest me with an example?

Posted: Mar 22 at 23:25

View 1 Replies!   View Related
Delete Function Does Not Delete The Targeted File
I could upload files based on a project. Whenever I create a project, a new directory is created with the directory name as the project_name e.g. this is a test -> this-is-a-test. But my problem is I couldn't delete a file in a directory.

function delete_image($id)
{
$this->load->model(array('work_model', 'project_model'));
$result = $this->work_model->get_work($id);
$result = $this->project_model->get_project($result->project_id);
$dir = str_replace(" ", "-", $result->project_name);
[Code]....

Posted: Mar 13 10 at 10:24

View 2 Replies!   View Related
Create A 'delete' Button To Delete A Row In A Table?
I am trying to create a 'delete' button to delete a row in a table, the code I have is as follows

Code: [Select]<?php  
include "connection.php"; 
// if id provided, then delete that record  
$CustomerID=$_GET['id'] ;  
// create query to delete record 

[Code]....

I get the error..Error in query: DELETE FROM customer WHERE id = '1' . Unknown column 'id' in 'where clause'

It is getting the ID# from the URL.. http://localhost/deleteAction.php?id=1

Posted: December 11, 2009, 12:19:06 AM

View 6 Replies!   View Related
Delete The First Row Of Data And Not Able To Delete The Other Rows?
Im required to create a database to store all the courses taken by a student and his/her grades. i have created the database and able to store and display all the data stored in the database.

I have a problem here: Im required to create a drop down menu for each row of data displayed in a table so that user can delete the data entry by simply clicking the "cancel" button from the drop down menu. I have created the code as shown below, the problem is I can only delete the first row of data and not able to delete the other rows.

<html>
<body style="background-color:#E0FFFF;">
<script language="javascript" >[code]....

Posted: 28 Days Ago

View 8 Replies!   View Related
Delete Row From Parent Table And Automatically Delete Matching Rows In Child Table Using Doctrine2
I'm trying to make a simple example in order to learn how to delete a row from a parent table and automatically delete the matching rows in the child table using Doctrine2. Here are the two entities I'm using:

[code]...

The tables are correctly created on the database, but the On Delete Cascade option it's not created. What am I doing wrong?

Posted: Jun 13 at 9:12

View 1 Replies!   View Related
Make A Button "delete Post" And "delete User" Which Will Only Appear When The Administrator Logs In?
i made a script but theres something i cant figure out:so what i need to figure out how to do is how to make a button "delete post" and "delete user" which will only appear when the administrator logs in. heres the structure of the sql table and the admin values:

username:admin
password:admin
usuario_nombre:
usuario_email:
usuario_descripcion:
usuario_url:
last_visit:
administrador:1

the admin is the only user that has the "administrador" value set to 1. the others are 0. so i need to add some script in 2 php files. so far it works with every user and its obviously wrong. i figured i have to select the "administrador" value somehow but i have to say i suck at mySQL.

Code:

$conn = mysql_connect( $db['host'] , $db['user'] , $db['pass']);
if ($conn==9) {
$delete='<a href="#">Borrar noticia</a>';
}

and in the html code i simply put

Code:

<?=$delete?>

Posted: March 23rd, 2009, 04:58 PM

View 7 Replies!   View Related
Delete From $var
Is it not possilbe to have a variable for the table name in a delete statement (mysql database). inside an if this button is hit statement I have:

$sql = "delete from $type where id_num='$number'";
mysql_query($sql);
echo "$sql";

when it echos $sql it doesnt have the $type var where the table name should be, it just leaves that blank.

Posted: July 20th, 2001, 09:55 AM

View 6 Replies!   View Related
Delete A Row
This should be simple enough but for some reason it's not working. The $name is a number which is being posted across when the user clicks submit. I want the PHP to then access the Database with this number and use it to delete the staff ID (which is a PK).

With this code I get the error:

Warning: ociparse(): supplied argument is not a valid OCI8-Connection resource in /homedir/ilex-s01/jmsuther/public_html/DeleteStaff.php on line 16

Warning: ociexecute(): supplied argument is not a valid OCI8-Statement resource in /homedir/ilex-s01/jmsuther/public_html/DeleteStaff.php on line 17
;

The code is:

$name = $_POST["staffnodelete"];
IF ($staffnodelete=="" )
{print "You selected $name - for deletion ";}

putenv("TNS_ADMIN=/u1/oracle/Products/shu10g/network/admin");
$con = OCILogon("username","password","10g");

$query = "DELETE FROM staff WHERE staffno = $name";
$query = $query_post [$name];
$stmt = ociparse($conn, $query);
ociexecute ($stmt);

Posted: April 20, 2007, 08:29:28 AM

View 2 Replies!   View Related
How To Delete
how to delete mysql row at php with checkbox?

Posted: 11:31 am on April 14, 2004

View 1 Replies!   View Related
Not Able To Delete
I've written a script to display all records in a database table and allow the user to select a record for deletion by entering it's ID number into a form at the bottom of the page.

When they click on the Submit button, it refreshes the page & shows the entire record that they selected and it asks if they're sure that they want to delete it.

There's 2 radio buttons that that allow them to select either "Yes" or "No". Everything is working fine up to that point. Where I run into problems is that no matter whether they choose yes or no, the record does not get deleted.

Posted: 05-04-2006, 11:20 PM

View 5 Replies!   View Related
Delete Row
I am having a little problem with the following row to delete a row from my table. This script works fine on my home testing server but as soon as I put it onto my main web server it does not work and gives me an SQL syntax error. PHP Code:

mysql_select_db($database, $connect);
$sql = "DELETE FROM prices WHERE id=$id";
mysql_query($sql) or die(mysql_error());

Posted: 08-02-2005, 04:52 PM

View 3 Replies!   View Related
Row Delete
what i am trying to do is delete all rows except for the last 20 rows, anyone know how this can be done?

basically i am keeping track of profile views so i know what members lasts seen who... my questin is how do i delete all but that last 2o for each $Member?

Posted: 12-02-2005, 01:42 PM

View 2 Replies!   View Related
Can't Delete The Right Row?
I have got 1 query under another one. I have got problem with the second delete query. I can not delete the right row. It always deletes the last row. The first delete query is ok. it deletes the one i click.

here is the screen shot of the output. When i delete burgers it works but when i press delete button for (32) Sauce it deletes the (34) Sauce

here is the code:

////////// if we submit then delete item////
if (isset($_POST['DeleteItem']))
{
echo "<h1> ID: ";
echo $_POST['cartitem_id'];
echo " deleted</h1>";............

Posted: Jun 2 at 15:24

View 1 Replies!   View Related
How To Delete Fields
I would delete with php, all record of a table mysql where the seven left chars of the field is equal to the data in input($seven_chars).

I have used the the belowe istrucrion but it do not work.how can I do?

mysql_query ("DELETE FROM my_table WHERE substr(myfield,0,7)=$seven_chars");

Posted: November 10th, 2001, 11:42 AM

View 1 Replies!   View Related
Delete A Line In PHP
What i want to do is to open a file read the file Select a particular line from the file and delete that line and close the file. How to do it in PHP.

Posted: August 28th, 2000, 01:49 AM

View 8 Replies!   View Related
Can't Delete Cookie
Right I am quite new to php but have managed to create a simple log in/log out thing with cookies. All was working fine and as expected until I added a new section of the site. The new section stores another cookie (latest message user has read) so that next time they visit the site it will highlight the 'new' messages.
However since adding this I can no longer log out.

Posted: November 1st, 2003, 02:43 AM

View 1 Replies!   View Related
Can't Delete Cookie, Help Please~
Page1: <? setcookie("book_id", $book_id ); ?>

Page2: <? setcookie ("book_id", $book_id, time() - 3600); ?>

Can't delete cookie at once but reload page 2 two times
how to delete $book_id cookie without reload?

Posted: August 3rd, 2003, 01:55 PM

View 3 Replies!   View Related
Cookie Won't Delete
I'm trying to setup a simple user authenication for my site. I'm using cookies to pass the credentials between pages. But the function header() is giving me problems logging in and logging out. As you can see in the code below, I try to redirect the user to a page after setting or deleting the cookies. The scripts redirect okay, but the user never logs in and never logs out correctly. The scripts works correctly (logging in & logging out) only if I comment out the header() function.

Here's my code for setting the cookie (login.php):

Posted: June 24th, 2001, 05:27 AM

View 8 Replies!   View Related
Delete All Replicated Except One
I ran PHP codes that creating tables and inserting records to tables., But something happened, someone of them is inserted more than once.

aa1345 | Ninsonoto
aa1345 | Ninsonoto
aa1348 | Ayumi Tohina
aa1348 | Ayumi Tohina
aa1348 | Ayumi Tohina

There are thousands of records there. So I think i have to write a script that able to delete all the replicated except one..
e.g : Delete four of aa1348 records.

Posted: July 19th, 2003, 01:12 PM

View 1 Replies!   View Related
Delete New Lines
I would like to delete the new lines, I mean the, so Itried this:
str_replace($row['facts_conten t'], &quot;
&quot;, &quot;&quot;) ;
But the new lines are still there, how can I do?

Posted: Fri, 05 Oct 2007 10:13:40 UT

View 2 Replies!   View Related
Can't Delete From Table!
I'm not to familiar to php and sql. I have this assignment to read from database in a table and I HAVE TO be able to push a button causing one costumer to vanish. something to do with id = $id... can anyone help me... and help me fast!

This is my code:

Posted: 12:48 pm on Mar. 30, 2004

View 1 Replies!   View Related
What Is The Best Way To Delete File ...?
I have script that allows a user to upload a txt file for processing, filtering, to save bandwidth,instead of user reuploading the file everytime he/she does a new process on the same file, i save the file to the server, and process from that file. What I want to be able to do is, when the user uploads a new file, or leaves the site, this temp file is automatically deleted (saves disk space).

Posted: August 4th, 2003, 11:07 PM

View 4 Replies!   View Related
Delete From Many Tables
I am trying to delete rows from a mySQL DB that consists of multiple tables. I am trying to use a function PHP Code:

Posted: December 25th, 2001, 04:37 AM

View 12 Replies!   View Related
SQL Insert And Delete?
Anyone know if there's a way to call a query but remove whatever you grabbed from the database, or would I have to do a query to retrieve what i needed, then follow it up with a delete on the same query results?

Posted: 2:49 pm on June 28, 2005

View 1 Replies!   View Related
Delete An Object ?
I use OOP with PHP4 and i don't understand something.

I have 2 classes VISIT & PLANNING like that:

class clVISIT {
var $when;
var $where;

//constructor
function clVISIT($_when,$_where) {
$this->when = $_when;
$this->where = $_where;
}
}

class clPLANNING {
var $who;
var $visit = array();

//constructor
function ClPLANNING($_who) {
$this->who = $_who;
for ($i=0;$i<10;$i++) { $visit = new clVISIT("foo".$i , "foobar".$i ) ; }
}

}

Ok, in the last constructor, we can see that i create new clVISIT
object. My question is: how can i delete some of them in the same
constructor ? is there a word like "new" but to delete ?

Posted: July 17th, 2005 12:16 PM

View 3 Replies!   View Related
Delete Script
PHP and MySQL and I'm having some problems getting
this script to work. I can't get this to work and I don't understand
why. I don't get an error or anything, it almost seems like the page
refreshes. I went to the phpmyadmin and the row is still in the
database. The $_GET parts work perfectly in another script and the SQL
statement works when I insert hard values in it. Any thoughts would be
greatly appreciated. Thanks in advance.

<form method="POST" action="<?php print $_SERVER['PHP_SELF']; ?>">
<table>

<tr><td colspan="2" align="center">Yes <?php
input_radiocheck('radio','yes_no', $defaults, 'yes'); ?No <?php
input_radiocheck('radio','yes_no', $defaults, 'no'); ?>
</td></tr>

<tr><td colspan="2" align="center"><?php input_submit('save','Add'); ?>
</td></tr>

</table>
<input type="hidden" name="_submit_check" value="1"/>
</form>

<?php

function process_form() {

// Access the global variable $db inside this function
global $db;

$isbn = $_GET['isbn'];
$artist_name = $_GET['artist_name'];
$album_title = $_GET['album_title'];

if ($_POST['yes_no'] == 'yes') {

$delete_sql = "DELETE FROM lounge WHERE isbn = $isbn AND artist_name =
'$artist_name' AND album_title = '$album_title'";
// Delete the record
$db->query($delete_sql);
print "The record was deleted";
} else {
print "The record was not deleted";
}
}

?>

Posted: August 11th, 2006 08:15 PM

View 17 Replies!   View Related
Delete File();
I was wondering if php4 has a built in function that could delete a file. In my case I need my php to delete a picture. (jpg, gif) Does php4 have the ability to delete an exsiting file? Something like this?? delete_image("../images/somePic.jpg");

Posted: September 10th, 2003, 06:28 PM

View 3 Replies!   View Related
Delete A File
How do i delete a file from my server with php?

Posted: November 12th, 2003, 03:08 PM

View 1 Replies!   View Related
Delete Not Working
Can someone tell me why this delete isn't working:

$strSQL = "DELETE FROM tblMine";

$rsEmpty = mysql_query($strSQL);

I just can't get it work.

Posted: August 2nd, 2001, 07:27 AM

View 5 Replies!   View Related
Delete From Database
I have code that does not delete from a database. The same code (cut an
paste in the same file, but different function and having a different query)
works. So, of course, I tested the query interactively. I echoed the query
and did a cut and paste when interactively connect to the database. That
one worked so it isn't the query since interactively it is seeing exactly
the same thing as the code produces.

Here is the code:

function deleteCatalog($catalog) {
$query = "DELETE FROM CatalogNames WHERE sCatalogID='" . $catalog . "'";
mssql_select_db($database_Login, $_SESSION['Login']);
$result = mssql_query($query, $Login);
...
}

The $query echos:
DELETE FROM CatalogNames WHERE sCatalogID='CMP'

As an example of code that works (in the same file)
function addToCatalog($cat_id, $cat_name) {
$query = "INSERT INTO CatalogNames (sCatalogID, sCatalogName) " .
"VALUES ('" . $cat_id . "', '" . $cat_name . "')";
mssql_select_db($database_Login, $_SESSION['Login']);
$result = mssql_query($query, $_SESSION['Login']);
...
}

The second and third lines are identical (cut and pasted) as in other places
in the same code. In fact, it is only in this file that I do all the
database work. Every other function works. This is the only delete,
however.

Posted: March 1st, 2006 02:15 AM

View 11 Replies!   View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved