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


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





Delete Specific Entry


I'm working on a CPanel on my website that gives me the posibility to edit both the blog, news and shoutbox. So far I'm done with adding new: news, shout & blog. But I'm stuck when it comes to deleting. Like if someone is spamming my shoutbox I want to be able to log in and delete the spam shout. I wish I had some code to show you for the delete part, but I dont even know where to start.




View Complete Forum Thread with Replies

Related Forum Messages:
Read Specific Entry From File Directory
Is there a way to use PHP to read forward from a specific starting point in a directory? Let's say I've opened a directory on a file system, I've read through the first X-number of entries, now I need to go do something else, but I want to come back later in the program and continue reading from the point I left off in the directory. This would be like reading through an array with an index value. Can I do this with a PHP construct of some kind, or do I have to call a shell script.

View Replies !
XML Trouble - Delete Particular Entry Tag
Dear All

I have an xml file of the following format

<?xml version="1.0" encoding="ISO-8859-1"?>
<contacts>
<entry uri="sip:vinayg@...">
<name>Vinay</name>
<sip> sip:vinayg@... </sip>
<Number> 9885821530 </Number>
</entry>
<entry uri="sip:vivek@...">
<name>Vivek</name>
<sip> sip:vivek@... </sip>
<Number> 9885821530 </Number>
</entry>
</contacts>

I need to device a function to delete a particular entry tag. Please
note that the entry tag is an array. Hence I need to device such a
function

deltag("abc.xml","sip:vivek@...")

which will remove only the entry tag with id vivek@... and
result in

<?xml version="1.0" encoding="ISO-8859-1"?>
<contacts>
<entry uri="sip:vinayg@...">
<name>Vinay</name>
<sip> sip:vinayg@... </sip>
<Number> 9885821530 </Number>
</entry>
</contacts>

I tried the following code but its not working.

$userfile = new DomDocument();
$userfile->load("test.xml");
$pt = "entry";
$temp = "sip:vinod@...";
$suser = simplexml_load_file("test.xml");
$count = 0;
foreach($suser->$pt as $val) {
if ($val[uri] == $temp) {
$userfile->documentElement->removeChild($val[uri]->name);
$countt--;
}
else
echo $val[uri];
$countt++;
}
$userfile->save("test.xml");

View Replies !
It Wont Delete The Entry From The Database. The Page Just Refreshes?
It wont delete the entry from the database. The page just refreshes? Code:

View Replies !
Delete Specific Row Out Of 3
Say i have three rows:

row1
row2
row3

How do i make a mysql query to delete a specific row out of the 3 only? So say i wanted to delete row2 from the 3.. ?

View Replies !
Delete A Specific Row
How can i delete a specific row from a mySQL table. I want to delete Image2 (or make the value of it is nothing, NULL)

<?php
$con = mysql_connect("localhost","name","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("npsari_other", $con);

mysql_query("DELETE Image2 FROM ads WHERE ID='$ID'");

mysql_close($con);

?>

Is this code right, because it doesnt work.

View Replies !
Delete Specific Records
On clients machine, currently to delete on trainee record it runs 10 queries to delete records from 10 tables. At the time of running all queries, server shows (104) Connection reset by peer. An error condition occurred while reading data from the network. I think it because of running 10 queries at a same time. Is there any possibility that through one line of query we can delete record from 10 tables. I've tried following query

DELETE FROM table1, table2, table3, table4, table5, table6, table7, table8, table9, table10 WHERE empID = 11;

But it gives ' error in query.

View Replies !
Delete Specific Texts From File
The text file is in variable length. We can't point to where to delete. But there are texts we want to delete in the text. How can I do ?

The only way I can think of is load entire file, match the text we want, replace the text, and then rewrite the file. Is this way correct ?

View Replies !
Know How To Delete Characters *after* A Specific Character?
If I have "JoeSchmoe - White Sox Rock", is there a way for me to have the script remove all the characters after the "-"?


View Replies !
Completely Delete A Specific Array Index
I was wondering if anyone could tell me if there is a way to completely delete a specific array index once it has been set. For instance, I have an array with 50 indexes (0 - 49) sizeof = 50. Now, I want to eliminate 10 indexes, making my array sizeof 40 and having array indexes 0-39.

View Replies !
Competition Entry Form / Random Entry Draw Script
I'm looking for an easy method to implement an 'entry form' for an online competition on my website (a competition page, if you like).

As I am running a 'trade promotion' I will need to apply for a trade permit license, therefore will need to satisfy the local authorities that the entry form and drawing method are acceptible.

The competition page will feature the prize on offer and the fields for entrants to fill in their details.

The tricky part I think is that I then require the entries to be able to be 'drawn randomly' once the competition has ended. Any tips here on how to successfully and easily run a competition from your site?

View Replies !
How To Tell To Send A Specific E-mail At A Specific Time
How to tell PHP to send a specific e-mail at a specific time (newsletter).

View Replies !
Echo To A Specific Div On A Specific Page
Is it possible to echo something from a php file to a specific div in a different specific html file?If so, can you let me know how to specify where the data should displayed.

$myName="john";

echo '$myName'//but i want to echo to a different page on a certain part of that page.

View Replies !
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();
?>

View Replies !
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" ?

View Replies !
Sending People To Specific Pages That Are Coming From Specific Pages...
I want to show some specific pages to people that comes to my site from
specific urls, I know the variable $_SERVER['HTTP_REFERER'] will be
used but how?

For ex if the visitor comes from a site that is like:

I want to send this person a specific.php . I used below code but not
worked:

<?php

if($_SERVER['HTTP_REFERER'] == "www.cominghost.com" ||
$_SERVER['HTTP_REFERER'] == "cominghost.com" ||
$_SERVER['HTTP_REFERER'] == "www2.cominghost.com"){

// Specific page html goes here

}
else
{
header("Location: index.php");
}
?>

This code not worked for some cases like if the visitor comes from
http://www.cominghost.com/account/targeturl.php or
http://cominghost.com/account/targeturl.php Ok I know the if statement
not working but How?

View Replies !
No Array Entry Vs Null Array Entry
Consider this statement related to Fields sent to PHP via an HTTP POST.

$A = $_POST["FieldName"];

If the page did not have a form field with FiledName, the result is
that $A is empty.

If the page DID have a form field with FieldName, but the field was
left empty, then $A is empty also.

How should I test $_POST to distinguish between these two conditions.

View Replies !
Add 1 To Entry
Whats the best way to add 1 to an entry? do I have to read it into a variable add one to that variable and then write it back to the database? or is there a way to just automatically increase an entry?

View Replies !
Next Entry In Db/get Next Id
I've been looking for a way to create next/previous links - but rather than for a search result set, it's more of a browse function.

I found the pagination script in the FAQ and I think I get it (don't have that many results yet to be honest!) but I can't quite see how that will work with what I want to achieve.

Basically, when a user clicks a link (from a list of available articles, which WILL be paginated ) I'd like them, within the article, to be able to click 'next article' and jump to the next article inthe database.

View Replies !
Changes The Db Entry
This sceipt below is supposed to take a db entry by id and allow me to alter just the $diwtitle variable. This it does successfully.. But after I change it and go to MySQL and look at the db, it has changed the $diwtitle variable in every row of the table. And that was not an intended outcome. Code:

View Replies !
PHP To Query Only The Last Entry
How could i make it in the PHP to query only the last entry of a certain column.

example column
Interest
2.5
1.3
4.4

php will extract 4.4, and when a data is enter to that column

Interest
2.5
1.3
4.4
5.0
php will query 5.0 by now

i use mysql_affected_row() but it is not the final outcome.

View Replies !
Mail() And An MX Entry
I am having a problem with the mail() function. Specifically, I have a client who has a MX account set up. They have a site set up on a remote server with a local server handling their mail.

The mail() function will send mail to myself, however, when I set it to someone on their sever, it sends it to the remote server, igoring the MX entry, and therefore stranded on the remote server in the catchall.

View Replies !
Crontab Entry
How can I have cron back up my database to a new file name each time Ex: db.001, db.002, db003....etc ? What would really be nice is if I could append the current date to the file ? Ex: "db.10-26-00" current crontab entry:

02*** mysqldump -u root -pZXCC helpdesk > /mnt/zip/db.backup

View Replies !
Reading Last Entry Only
I am sending data to a text file, and displaying the data on the return page. Then it emails that entry only. (this works fine) But when I call the second page, it displays everything in the text file. Is there a way to to call the last entry to the text file only?

View Replies !
Duplicate Entry
this functions adds new locations in am_ups_shipment_location table after a tag in XML is detected it is pointed towards this function and this function then goes and adds the new location.

for the first time when i run the php prgoram the new location gets added.but when i refresh ,again the same location gets added but with different id[id is on autoincrement].

here is how my table looks after refresh.[you can see duplicate entry].This is what i dont wnat...i dont want a duplicate entry.
Can you please help me get rid of this duplicate entry by writing some update functions and checking against already present data in the table? Code:

View Replies !
Pws Autoexec.bat Entry?
do you kno when you install pws, does anyone remember the line it adds to the autoexec.bat? some dodgy software has corrupted the file.

View Replies !
Check Entry
I want to use my signup for to my site, but I want to check one of the entries to match a 4 digit code. This is just the entry code, I have a input box above for all of the sign-up info, including the 'code'. I want the code to be 2369 for now, so code == 2369 is the only way it'll allow them to signup. PHP Code:

<?
    }
    else
        {
        // includes
        include("dbconex.php");
        // set up error list array
        $errorList = array();
        $count = 0;
                                    
        // validate text input fields
        if (!$username) { $errorList[$count] = "Invalid entry: Username"; $count++; }
                                    ....

View Replies !
How To Get The Latest Entry
I need to get the latest entry into my db table based on the datetime stamp in the following format: 0000-00-00 00:00:00

I myust be having a mental block because all I can think of is running a loop, and setting limit to 1, which I understand is stupid.

View Replies !
Edit Entry
I've accomplished half of what I want to do. I have an 'edit' link on blog entries and writing pieces for my upcoming site, and clicking it brings up the piece within a form so I can make changes. Now the only trouble is processing the form and having PHP and MySQL make the changes.

I'm having trouble figuring out exactly how to replace or overwrite an entire string. I came across the Locate command, but I was under the impression it was useful to search for text to replace, not necessarily (or efficient) for replacing an entire string. Also, does the fopen command work with MySQL queries?

View Replies !
Redirect After Entry
I have PHP code that allows users to give feedback. Right now after the enter a comment it just displays a message, instead, I'd like for the code to reload the page.

For example, they are on item.php?itemID=10 page and add a comment, I'd like it to enter their info into the DB, then take them to item.php?itemID=10 again...

Here's my code:

View Replies !
Time Since Entry
I was on bebo earlier, and saw the comments say "1 Hour Ago", I was wondering if I had a mysql row that had a timestamp under the name "date", how could I have it so that if timestamp less than thirty days old, it would echo <img src="images/layout/new.gif" alt="New Product!"/> but if it was older than 30 days, it wouldn't echo anything. I have thought about it and there must be specific functions, that compare that timestamp to the timestamp of now, it seems like something php wud have.

View Replies !
Match A DB Entry
I need a way to match in the DB every entry in a row that has &#391;/' at the beginning but it needs to only be &#391;/' so entries that have &#3915;/1/' should not be matched

View Replies !
Returning An Sql Entry
I am inputting a antryp to my database using the following code:

$query1 = "insert into topic (description, forum_id, starter)
values
('$topic', '$forum', '$username')";

$result1 = $handle->query($query1)

i need it to return the ID field from the record just created.

View Replies !
Duplicate Entry?
my management system stopped working because of this error:

Please notify the admin that the script is connecting to the database, but not inserting the information Duplicate entry &#39127;' for key 1

And there isnt a duplicate in the database. This is where the error is said to echo:
login_script.php

PHP Code:

View Replies !
Database Entry
I am creating a bulk e-mail sender to send e-shots to our clients. I have many e-mail address in excel and simply want to copy and paste them into a form textarea field and use php to insert each email address into a database.

View Replies !
Mulitple Database Entry
If I want to enter some info into 2 database's with some fields being the same eg name and pass and the key 'uid' to be the same i got this code and it give me a error, PHP Code:

View Replies !
Automatic Date Entry
Im doing a new submission script, through a form, and ive got a field in the database called date_submitted. I was wondering whether to use timestamp or datetime field.
And how do you do a query to put the current date in.
So basically i want the date that the article was submitted automatically put into the database as this is a basis of a query for another part of my site.

View Replies !
Selecting First 300 Characters Of An Entry?...
I'm creating a news database where I'd like to display each article Headline along with the first, say 300 characters of the article. At it stands, it's displayiong the full article in the table. PHP Code:

View Replies !
Newsscript, Last Db Entry First, First At The Bottom ?
I coded a small newsscript. How can i get a table showed last entry as first and so on ?

View Replies !
Random Entry From Mysql
I am trying to select a random entry from mysql. Anyway - My version of mysql doesn't have the built in rand() function, so I am using PHP's. Anyway - I wrote the following function...

function displayguide(){
$rand = rand(10,202000);
connect();
$query = "SELECT *, $rand as random FROM guide_rotater ORDER BY random LIMIT 1";
$result = mysql_query($query);
$this = mysql_fetch_object($result);
print "<b>$this->title</b><p>$this->description<p><a href="$this->url"><b>Read the guide</b></a>";}

Anyway - it works, the only problem is that it uses the same $rand number for all of them so it isn't random I can't think of a way to do this using php's rand function.

View Replies !
If, And, Or Code For Data Entry
I have a drop down box with 'Incomplete', 'Resolved' and 'Complete' as
part of my $status variable on a form and a text box called
'$datecomp' that passes the data from both variables to a MySQL
database.

How might I include an 'if' statement where if the drop down selection
for variable $datecomp is 'Incomplete' or 'Resolved', an error message
is displayed on the data entry confirmation page that requests the
user to click their browser 'back' button and enter a date in the
'datecomp' field? I was trying to modify the following code but so
far, without any luck. In other words, if 'status' = Complete or
Resolved, trigger the error on the confirmation page where a user
clicks their back button and either enters a date in the datecomp
field OR leaves the drop down box as Incomplete.

if (!$datecomp || and $status="Complete" or "Resolved")
{
echo 'You must enter a DATE for items marked Complete or
Resolved.<br />'
.'Please click the browser BACK button, fill in a Complete/
Resolved date and try again.'
exit;
}

View Replies !
How To Change An Entry Number?
I have a table called comments and a field inside this table called entry. One of the values in the entry field is 7 but I want it to change to 3. I have another field called ID where entry 7 (the one I am trying to change) has the ID of 20. Basically something like this: where id=20 change entry=7 to 3

The line of code below is is what I have tried to use to change the ID of this entry but it didnt work (I have tried other variations). Code:

View Replies !
Form Entry List
I have a form with one box into which users type a few words (an email address).

That entry is emailed to me. I need to copy each entry into one text file automatically so I do not have to copy them manually out of each email one at a time. The result would be one text file with the entries listed down the page, one by one.

View Replies !
Checking The First Date Entry
In my database I have 2 fields (month and year). In the month field is the full month names (January through to December). In the Year field there are entries of 2006 and 2007 as there are only 2 years worth.

I would like to be able to search through the fields find out what the first month and year entry is and display them inside a drop down menu through to the latest month (September 2007 down to the earliest) - but the latest month is not going to be the newest entry inside the database, it needs to be the month we are in (real time).

View Replies !
Check For Existing Entry
I am currently trying to INSERT some data into MySQL database. What would be the correct way for checking if an entry of the same name already exist in the primary key. I was planning to do it like this.

SELECT name FROM table WHERE name = 'whatever'

Do a loop. If data is returned, prompt user that entry exist. Else, continue to INSERT.
Is this the correct way to do it? Is there a shorter way? And It is alright if I execute a lot of SQL query at one go right? What should I watch out for?

View Replies !
Allowing 1x Entry Per Day Per Email
Creating a form for a contest that users can only submit the form 1 time per Day ( 12am- 12pm). On 1st entry, form submits and goes to success page. On duplicate during same day, form goes to "Sorry, only 1x entry per day". How would you go about only allowing 1x entry per email address per day? Would you recommend expiring cookies? Or?

View Replies !
Checking For A Duplicate Entry
I have tried the following on a small PHP with only 2 entries and it works find, now I have extended the code a lot it does not seem to work. It is coming up with an error and still putting the entry into the database. It is coming up with the following error "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/body1975/public_html/input.php on line 143"

line 143 is " $num_rows=mysql_num_rows($mysql_result);" I have put stars next to the offending line of code. Can someone tell me what I have done wrong.

-------------------------------------------------------

$FULLNAME = empty($_POST['FULLNAME'])? die ("ERROR: Enter a Fullname") :

View Replies !
Get Next Entry With Closest Date...
I'm trying to run a query to return a result from the database that is enter with the next calendar date.

So, I have two entries in the database, entry 1 has a match_date of May 6 (20060506) and entry 2 has a match_date of May 13 (20060513). So right now, entry 1 should be displayed until May 7, then May 13 should be displayed. Code:

View Replies !
Add Entry Into Database OnClose?
i've got a javascript timer that starts when someone visits my page. And when they leave i need to add the duration to a database. how can i do this?

I can't get anything to work with onClose or onUnload! would it be better to use sessions? how can i get the duraation into the db when someone leave my site?

View Replies !
Duplicate Entry '0' For Key 1 Error?
I have a table which is like:

[MYSQL]
CREATE TABLE word (
wordno DECIMAL(6) NOT NULL,
lemma VARCHAR(70) NOT NULL
);
ALTER TABLE word ADD CONSTRAINT pk_word PRIMARY KEY(wordno);
[/MYSQL]

and I have a word.sql data file like below: Code:

View Replies !
Ldap And Entry Attributes
I have the following problem when trying to retrieve Windows 2003 AD entry (objectclass=person).

<?php .........

View Replies !
Random Entry From Database
How can I make a random item from my database be displayed. I'm trying to do that, and also let people click a button and get a random item. something kinda like a random quote, but go to the page of the random item. Would this be hard. This is what I've been developing for a few days, check it out and let me know what you think. btw, it has a few quirks in the design in mozilla/linux right now. so use IE if you want to see it like it will be soon in all browsers.

View Replies !
#1062 - Duplicate Entry &#391;' For Key 1
I get this message when I try to upload parts of my backup to the database:

INSERT INTO ibf_admin_logs
VALUES ( 1, 'forum', 'donew', 1, 1090252103, 'Forum 'News' created', 'IP blocked out')
MySQL said:

#1062 - Duplicate entry &#391;' for key 1

Then the actual line in the dump would read: Code:

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved