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 Data In Flatfile?


I know this is a total noob question but im just getting into flat file scripts because a friend of mine has a site that does not have a database. so i told him ill try making him a news script made with flatfile so he doesn't have to switch hosts.. but my question is..

is there a way to delete data thats in flatfile? like set them in an array or something?




View Complete Forum Thread with Replies

Related Forum Messages:
Regexp To Get Data From Flatfile Db
I was given an application with existing data to migrate into a new application that I wrote without knowing of this data. Consequently, I now have the difficult task of extracting the data and putting it where I need it. The data exists in a text file in the format: Code:

View Replies !
Delete Data From The Data Base
Im doing the PHP-MYSQL program to search the data in the database and display on the HTML Page. Everything is working fine till now. Now I want to know that, how to write program to delete the searched and displayed data from the database.....

I know the MySQL Syntax to delete data from database...Im not asking about MySQL programming. I want just an idea, how to do the delete process. Here is My full PHP script, Code:

View Replies !
Delete Data
i try to delete the data by hit the delete button. but no changes. here i submit my coding.

PHP Code:

<?php
if (isset($_REQUEST['delete']))
$select ="DELETE from details where amount = $nt[amount]"
?>

View Replies !
Delete MySQL Data
I am building a lunch ordering system for a company. The employees can login, order lunch, and the administrator can see what everyone ordered for lunch in the admin panel. The problem is that when the employees enter data, it stays in the database until they update it. If an employee is sick, their lunch order from the previous day is still in the database. Is there a way to clear those values they enter at a certain time in MySQL.

View Replies !
Delete Data From Database
Let's say i have two tables,

table_one;
userid,userinput,indexno

table_two;
cond,qant,amp,indexno

the indexno in table_one and table_two are the same.if i choose to delete one row of data in table_one,i want the data with the same indexno in table_two be deleted as well.
how can i achieve this?

View Replies !
Delete Data From MySQL Database
I am new to PHP and MySQL but I have setup a MySQL database. I can view the information in an HTML table using PHP scripts and can delete an entry form the database table, but what i need to do is to be able to delete an entry by selecting a radio button next to the relevent information however when i try to add a form in the PHP script i get an error.

View Replies !
Insert, Delete, Update And Query Data Via DBX
can someone guide me how to connect to mysql using DBX and whats the syntax on inserting, delete, update and query data.

View Replies !
FlatFile
How do you read a flatfile (.txt) until end of file? I dont want to open it with bytes. I am trying to open the flatfile and then separate the string by using explode |. I want to read the whole entire file into 1 string so that I can separate into an array.

View Replies !
Regarding Flatfile
I am trying to create a php file that searches each line of a flatfile like a search engine. If someone enters type or typ i want it to search the flatfile for type or a whole string that has the type in it.

View Replies !
Listing Table Data With An Option To Delete Each Individual Item.
Was wondering if anyone could help me with a PHP, MySQL problem. I am
completely new to PHP and MySQL. I have been trying to find a way to
list data from a table on a web page and after each individual item
have a hyperlink to allow users to delete the information listed. Can
anyone help?

i.e.
Name Age Sex
------------------------------------------
Adam 21 M delete
Betty 22 F delete
Chris 23 M delete
Daisy 24 F delete

------------------------------------------------------------------------------------------------------------------------------
(delete after 'Sex' would be the hyperlink to delete that entire line
(row) from the table).

View Replies !
Flatfile Vs DB Questions For BBS Script

I am 50% through of coding a new BBS using PHP.

I started the script with flat-file system since I believe it would offer better opportunity for people to host their BBS on server without having to pay extra for database backend.

I have heard a lot of comments about using a database instead.

I believe that:
Databases were designed primarily for applications that use a great number of 'small' but 'relational' data cells. Many parts of a BBS would fall within that category but posts themselves do not.

Database on the other hand has it own limitations. To start with, it is another application that is running on the system which will share memory and resources. It has limits on the number of connections. Many users have already come across that when trying to connect to busy databases.

I have seen the 'rush' to shove everything into a database. I have seen fairly static websites stored on databases. It would be a lot faster and more efficient to output an 'txt' or 'html' doc via simple 'include()' rather than getting the same chunk of data from a database. The larger the chunk of data gets, the less useful a database may prove to be.

I trust [and it has to be proven later] that a well designed script could accomplish what is required without the extra overheads.

It would also be advantageous for the users as the number of free or cheap hosts with PHP and database are very limited.

BTW, some servers prefer the use of DB since besides charging extra for it, they can limit the connections and thus bandwidth.

Another handicap with databases is the backing up the board. I am designing the board so that it could be updated or backed up via ftp. Backing up from database would have limitations set by the server, php.ini and database. You will find many administrators have reservation as they can not back up databases of more that 2 MB. While that would be huge database if the data stored on individual cells were small, in case of BBS; that does not amount to anything ...

View Replies !
Read Huge Flatfile
I got a huge flatfile (.txt) that I want to import in a mySQL db (1 line in 1 cell in mySQL). The file´s size is about 26 MB. Now I am trying to read and import the file that way: PHP Code:

View Replies !
Looking For A FlatFile Database Driver For PHP
Introduction:
I need access to database-functionality for a project.
The problem is I cannot be sure that a database exists on all places where I
need to run the code.
I can only expect PHP to be installed on all the intranets where the
software runs.

So to mimic some databasefunctionality I first thought to use plain files to
store the data. Or maybe write away my datastructures serialized.
That is a bit cumbersome, but can be done.
Things would be nicer for if I could use real SQL.

My question:
So I wondered if there is some way for me to use real SQL-statements on a
flatfile. If that is possible I would really safe me a lot of trouble.
In that way I can use real SQL and do not expect my customers to have to
install mySQL or Postgres.

I hope I make sense. :-)

View Replies !
Speed Of MySQL Vs Flatfile
I'm trying to decide whether or not to store layout data, configuration data, and traffic data in a database or a series of flat files. This application needs to be scalable and take into account that anywhere from 0 - 1000+ users will all be hitting it at the same time.

This is forum software, I might add, and after reworking the code, will be on par with the kind of featureset vBulletin provides. So take into account that there will already be a load from content data on the database. Anyway, I want to know, which is more efficient (ie speed, server resources, etc) to use for information which will be used on every page of the application - flat file or MySQL?

View Replies !
Parsing A Flatfile Database
Im working with a flatfile database text file and was wondering if anyone might be able to help me out with what I want to accomplish. Basically the .txt is a listing of events that my work shows everyday. I have everything working perfectly so far with outputting the data. Code:

View Replies !
Create A Php That Would Read From A Flatfile
How do you show like items 1-20 and have it should items 21-40 and etc. How do you create pages for 1 php to display the items? I use to create each page 1 by 1 and I find that a hassle to do and thought.

I would create a php that would read from a flatfile and generate the links and text but I dont want it to show all of them I want them to have pages like if it exceeds 20 i want it to start a page 2 within the php.

View Replies !
Converting Flatfile Code
I think I've got most of it converted, but would like help on the following portion. Currently, the code writes the bot data to a flatfile, and the following function checks for a match of remote_addr: PHP Code:

See code below

Will this work ok? Does anyone see anything that happened in the flatfile version of the code that I neglected to take care of? Is it efficient? Dealing with things like this, the numbers can add up quick, and I don't want it to get bogged down.

View Replies !
Flatfile Comments Script
I do alot of work from other computers, and find myself constantly needing to jot things down, which i later access at home. I'm in need of a script that processes a form like so: Name: Submit. I have no problem insterting the data. The problem arises when i want to delete a specific entry.

View Replies !
Fopen In Script Managing Flatfile Db
I am attempting to create a PHP script which will enable me to post information to a flatfile db (pipe delimited plain text file) which will then be picked up by another PHP script and used as the source for my RSS news feed.

I have adapted a PHP script which writes to a flatfile db and I have converted it so that it allows me to add, edit and delete articles, and store them in pipe delimited format in the flatfile db.

The problem that then arises (as you will already have guessed) is that new articles are added to the end of the db, whereas I want them at the top so that new articles appear first in the news feed. I have tried and failed to get the PHP newsfeed generator to read the lines in the flatfile db in reverse order.

So I went back to the PHP script which manages the db file, and hit on the idea of implementing the following sequence of events, to take place when I click on the 'submit' button in the 'add article' form:

1. The contents of the db (news.dat) are copied to a secondary file (news2.dat), overwriting whatever was already there. This bit works - woohoo!

2. The data entered in the form is then written to the db (news.dat) in write mode, overwriting what was already there (news.dat now consists only of the latest article). This also works - woohoo again!

3. The data in news2.dat is then written to news.dat in append mode, which should achieve the desired result (new article appears first, old articles follow in original order) . . . except that this bit doesn't work - big Homer Simpson "d'oh!!"

I'm well out of my depth here, cutting / pasting / adapting bits of code from elsewhere, reading guidance about fopen, fwrite etc on various sites but without really getting an understanding of how to structure a long sequence of code - PHP Code:

View Replies !
Flatfile Go To Line In File And Insert
How can I insert a string at a certain line in a file? I have a file, in which I would like to insert a string on an empty line (line 3).

Is there an other way then to go to a specific line in a file and add some content, then to read through the file, and copy the content into a variable, untill you reach a certain line, insert, read the rest of the file, and re-create the file from the variable? Code:

View Replies !
Reading And Overwriting Text Fields (flatfile)
I've created a website which shows me what's on telly for the day, based on the name and episode it's able to pull the episode information, the time it airs, and other bits and pieces. I've created a flatfile to store the episode information in, in the following format: Code:

View Replies !
How Would You Search For A Part Of A Word In A Whole String Or Flatfile Line.
How would you search for a part of a word in a whole string or flatfile line. for example like: the user inputs tax or another word and if the input is part of a larger word like taxation then it will print the result. Im trying to create a search that will allow the user to input small words and it will search the whole file and if a string with that file is found it will print it.

View Replies !
Convert My MySQL Driven Script To Include A Flatfile Option
I have not worked with flatfile data manipulation enough to know where to begin.

I understand that I would have to duplicate every part of the script that pulls or sends data to the database and modify it to work with a flatfile, but I was wondering if anyone knew of a start-to-finish basic tutorial for handling data when saving it this way.

I have found small tuts at devshed and codewalkers, but have not found enough real world examples to put something together.

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 !
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.

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

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

View Replies !
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.

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

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

View Replies !
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 Replies !
Delete From Dir....
I have a field named 'path' in my db that has the exact same number(path) as its counterpart folder under cart/zips.

So my path in my db might be &#65533;', and in cart/zips you'd have the folder 23423423. There is a corresponding session with each 'path' row. Based on the session, I want to retrieve the path name and delete its counterpart folder name (and all it's sub-files it may contain).

The delete_all_from_dir function below is deleting the whole zips folder when I only want it to delete the path folder below it and its contents. Code:

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

View Replies !
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.

View Replies !
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.

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

View Replies !
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):

View Replies !
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.

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

View Replies !
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:

View Replies !
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).

View Replies !
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:

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

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

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

?>

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

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

View Replies !
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.

View Replies !
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.

View Replies !
Delete From Array
let's say I have an array $letters(a,b,c,d,e,f) is there a function that will remove 'd' from the middle. I'm looking for something like array_delete($letters,'d');

View Replies !
Confirm Delete
The below code updates information in a table. I'm trying to add some type of validation to confirm that the user wants to continue with the update. The javascript is not doing what I want it to it makes the page white then I get a header error. Code:

View Replies !

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