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 Fixed Number Of Records


i have a table with one field. this field saves times as records. i want to there are 40 recoreds always. in other mean when inserts 41'st record then 1'st record be delete
how to delete fixed number of records at a time of first of my records asc (like select).
in other mean i want to like: delete from table order by time asc limit 0,1




View Complete Forum Thread with Replies

Related Forum Messages:
Find The Closest Number In A Given Fixed Set Of Numbers
I have a number and need to find the closest number in a given fixed set of numbers. The fixed set of numbers are 1 (increasing by 6.5%) -> Infinity. (1.000,1.065,1.134,etc.)

View Replies !
DELETE RECORDS - Database Adding New Records
iv got the database adding new records, and now I want it to display all of the records that are there buy name and id number, then i want u to be able to type in the id number of the customer u wish to delete and it shoudl delete it, sounds good buts its not actually deleting the record. it says it does, but its not doing it. Code:

View Replies !
Records Won't Delete
mysql_query("DELETE FROM guestbook WHERE id = '$recnum'"); It works fine on my local server but it doesn't delete records on the remote server. any ideas?

View Replies !
DELETE Records
I am going to write a php script to delete some records based on values supplies by the user. I was just wondering if the query is correct but there are no records to delete for example if this query was executed but there was no testId 7, would an error occur or would the query be performed but just not delete any records? PHP Code:

$testId = 7;
$q="$q="DELETE  FROM test WHERE testId = $testId";
mysql_query($q, $link_id)or die(mysql_error());

View Replies !
Wants To Delete Old Records
I want to delete records that are more than 7 days old($keeptime). I am new to this and can't figure out the correct code. The table is called 'x4tables' and the field 'tdate' is a timestamp. I have used: Code:

View Replies !
Delete Records Since A Week
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:

View Replies !
How Do You Delete Records From Mysql
Could someone please show me how to delete records from mysql. Maybe even an example in a loop that deletes records based on a criteria.

View Replies !
Delete Records From A Table
I have a table its called queue. It has a field called id. I want to delete all records in the table apart from the ones with id equals to 74 or 75 or 87. How do i do that?

View Replies !
Forms To Delete Records
I am trying to make a PHP script that displays all of the records from a database, then allows a user to edit or delete the records via a form. I need a checkbox beside the names and a text field with a number beside each name. Is there a way to make it delete all names with a check beside them and update all number that have been changed when the user clicks submit?

View Replies !
Delete Records From Table 1
I have a script that doesn't delete records from one database when it should, and now I have to do this myself because database is big and causes problems on the server. What I have is:

TABLE 1, field auction
TABLE 2, field id

so I would like to delete all records from TABLE 1 where the value of the field auction doesn't match the value of the field id in TABLE 2. Can someone help me on this, please? I need to get this database cleaned.

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 All Records Starting In R
PHP Code:

$result2 = mysql_query ("DELETE FROM r_CompTables WHERE CompID = R??") or die("DELETE error: ".mysql_error());

I have this code but I want it to delete anything start in R. R will be followed with a number so it could be R5 or R91.

View Replies !
Delete Records Older Than 14 Days
Does anybody know how to make a script that automatically removes mySQL records older than 14 days?

View Replies !
Want To Delete The First Letter In A Column With 275 Records
table : product
column : code

in this column i have 279 records with bv. S1092734 i want to delete the first letter in all those records.

View Replies !
Delete Selected Records From Table.
Can anyone see why this connection doesn't work? It's suppose to delete selected records from my table.

<?php

if (isset($_POST['delete'])) // && isset($_POST['delcus']))
{

foreach ($_POST['delcus'] as $val)
{
echo "$val";
$conn= mysql_connect( "localhost", "user", "password" );
$sql = mysql_select_db( "snow" );
$del = mysql_query("DELETE * FROM request WHERE qid =" .$val);
//$rows = mysql_num_rows($del);
$rs = mysql_query($conn, $sql, $del);
if($rs)
.........................

View Replies !
Multiple Delete From A List Of Records
If I have a list of records from a database on the screen, each with a check box beside them, how would I delete all the records that have been ticked? I assume I would use a variable similar to checked[], but not sure what syntax I would use to remove them from the database? Would I loop round each record comparing the checked[] value and it it's set, delete the record?

View Replies !
Do A DELETE Statement To Remove Any Records That Don`t Match.
I`m just trying to figure out the best method to delete my records and wondered if it was possible to do a DELETE statement to remove any records that don`t match. Here is my code so far:

$Query="select blah its huge:-)";
$RESULT=mysql_query($Query);
$my_rows=mysql_num_rows($RESULT);

for ($a=0; $a<$my_rows; $a++){
mysql_data_seek($RESULT, $a);
$Array = mysql_fetch_array($RESULT);
printf("%s<BR>", $Array['Email']);}

My Query returns Matched Records, what I would like to achieve is deletion of the records that didn`t match, would it be possible to do that under the printf statement. So delete all the records in the table that don`t match up to $Array['Email']??

View Replies !
Delete Option From My View Records Page
I have a list of things I need to do with my database - but this is my next hurdle - the delete query within my view records page. I want to be able to click on a button or link to delete a record in a table. I was envisaging that each record would have a delete button or link next to it and clicking that would remove it. Here is the script I have created to view "Devices": PHP Code:

View Replies !
Delete Records And Files In 1 Statement At Same Time?
How can i delete records and files in 1 statement at same time?

View Replies !
Delete Multiple Records In The Same Database Querie?
I have some code that deletes records from the database, in a loop. However its prety inificient as it makes a seperate database call in every loop whcih is slow. PHP Code:

for ($i=0; $i<count($idarray); $i++)
          db_query("delete from clicks where id='$idarray[$i]'");

Is their a more efficient way of doing that? It is posible to delete multiple records in the same database querie?

View Replies !
Database Delete Repeat Records And Add Up Totals
I have a database full of order records for our website. My goal is to delete people from the same 'address' field and add up the 'total' into one record. Can i get some example code on how this would be done?

View Replies !
Automatic Delete From MySQL Database Table Expired Records?
I have a question . . .

how can i delete from MySQL database table automatic expired records ?
?

One think is to make a service that deleting the expired records . . .

Any other method ?



View Replies !
Auto Delete The Old Records But What If Server Clock Was Set Up Wrong In Maintenance?
I want auto delete any events that the event date is at least 1 day older than current date. No problem for the php programming. get the current data (server clock), check the events date and delete the old records. My problem is that for some very rare cases.

Say if for extrem cases I have 1000 new events saved in database. But somehow, I or the the hosting company do the server maintenance, and reset the time clock of the server, in case in the maintenace, the server time clock was set up wrong say 2005, was set up as 2006. Code:

View Replies !
Number Of Records
I want to find out how many records, but I am using LIMIT in mySQL so if set the limit to 20 and I have 56 records then it will display 20 instead of 56.

I have been using:
mysql_num_rows

What should I be using?

View Replies !
Counting Number Of Records
I am trying to do 2 things. First, i want to count all the records that i get when i query the db. Second i want run a loop to display all of the info.

The loop works fine, (it displays all the results) but when i try to count the records, it only echo's 1. Here is the code i'm using. PHP Code:

View Replies !
Finding Number Of Records
I'm attempting to query a database to find out how many occurances of a particular value exist. So I'm trying to select where the same VendorNumber occurs less than twice, or more than twice. If it only occurs twice I do not care. I would like to also be able to see what the Value of the VendorNumber is. I've tried various syntax with count, distinct, and having, but I'm not sure I understand how it all works. In brief, I have a table called Vendor, which has the following entries for the VendorNumber field:

123123
123456
123456
123789
123789
123789

I'd like the query to tell me there is 1 occurance of less than 2, and there is 1 occurance of more than 2. It would be fine if these are separated out into two different queries to put into a php page. I'd also like to see the VendorNumber displayed.

View Replies !
Can I Put A Cap On The Number Of Records Added?
This one is a new one for me. Is it possible to limit the number of records any one "member" is able to add to the MySQL db?

In other words, basic members are entitled to add 50 items, but premlium members 100 items.

View Replies !
Count Number Of Records More Than Zero
I would like to check if the number of records is more than zero. $sql = "SELECT count(*) FROM Hardware WHERE Location = '$location'"; how to continue from the above statement?

View Replies !
Limiting Number Of Records
I was wanting to find out how to limit the number of records displayed from a text file. Is there a way to limit the number of lines read from the text file?

View Replies !
Adding A Number To All Records
is there a query structure that will enable me to add, say, 10 to all records in a certain column without doing 2 queries for each record (one to get the current value and one to update it with the new value.

View Replies !
Delete The Number Of $a From Range Of The Rand ?
$a = rand(1,100)

is that possible i delete the number of $a from range of the rand ?
for example

$a= rand(1,100)
$b = rand (1,100) // here min 1 , max 100 , but not including $a 
$c = rand(1,100) // here min1 , max 100 , but without $a and $b

View Replies !
Counting The Number Of Records In Table
I want to count the number of records which apply to a repeating id field. (the user id remains the same, but their are several records which relate to the user. I want to know how many records in the table exist for a specified user id) Does anyone know a function for doing this?

View Replies !
Display Number Of Records Into Pages
we are using oracle database, Oracle Select statement is not supporting the LIMIT , Is there any other way to display records into pages.

View Replies !
Count The Number Of Records In A Table
I just want to count the number of records in a table that meet a certain set of conditions: Getting an error: Warning: mysql_result(): supplied argument is not a valid MySQL result resource code:

View Replies !
Counting Number Of Related Records
I have a database which contains a listing of employee names along with the results of completed exams they have done. So each record contains their name and the name of the exam they have completed.

What I'm trying to do is pull out how many exams each employee has done, and then email myself a message when all 15 exams have been completed. Code:

View Replies !
Count Number Of Records Returned
I want to know how many records were returned from a stored procedure.

$rs=odbc_exec($conn,"EXEC select_Contacts ".$sessionID);

I have tried: odbc_num_rows($rs) but it always returns -1 even though records are printed out.

View Replies !
Suffix A Number To Duplicate Records
When querying the DB for records, many of the records have the same name. These names are not really duplicates because they are unique.

For the records returned that have the same name, I would like to suffix a number at the end.

For example:

john01
john02
chris01
chris02
chris03
tom
jack

Btw, I do not want to add the incremented ID, because there are many records, 100,000+ and above. The ID would be too big of a number to add as a suffix.

I need to add the suffix number to the duplicate names and not to the names that do not repeat.

View Replies !
Display Problem (number Of Records)
My company sends out a newsletter displaying new artwork aquisitions- my boss would like to have the number of works that we have by an artist displayed next to their name. Meaning- we show the image- then the artist name and the name of the artwork. He would like for the right number to show up in parenthesis next to the artist name.

We have that displaying in another area (in a drop down search box). When you pull down the box it autopopulates with artists in the database and shows the number next to their name. Code:

View Replies !
Show Number Of Records Held
I want to display the numbers of records shown in each County on my database. PHP Code:

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

$query="SELECT county 'Bedfordshire', 'Berkshire' FROM t_data";
$result=mysql_query($query);
$num=mysql_num_rows($result);

while ($row = mysql_fetch_array($result)) {

$Bedfordshire = $row["Bedfordshire"];
$Berkshire = $row["Berkshire"];

}

How dow I show the number of records on Bedfordshire, Berkshire etc. I am echo'ing $Bedfordshire which shows the data not the number of Bedfordshire records held.

View Replies !
Limiting Number Of Records Stored In Database
Is there a way I can limit the number of records that are stored in a database? I am using a PHP guestbook script for personal use and only want to save say the last 100 messages.

View Replies !
Retrieving And Writing Out A Large Number Of Records
I'm querying a remote mysql database and retieving a large number of records (600K records with about 12 columns for each record) which I am then writing out to a file on the local machine.

I'm having problems with the process timing out, I only get about half of the records, and I'm wondering if there is a better solution then the one I'm using? Either inncreasing the timeout, or better yet by optimizing my code? Mysqldump is not an option for me at this point. Code:

View Replies !
Sending Variable To Display Number Of Records To Write?
Sorry, couldn't come up with any reasonably short subject.

I am sort of new to PHP. I've got an event registration database (MySQL). In it, I have two tables, one for the registrant's info, and one for the reservations. Assuming that one registrant can make more than one reservation.

There are 4 types of registrations. What I would like to do is to have the first page filled out with the registrant info, and have the registrant select the number of each type of reservations he/she would like. These numbers will not be written to the database, but will be used to determine how many of each type of reservation will be shown in the next window. Once the info is submitted (and written to the database), the user will then be taken to another page where they will enter the name for each registration, as well as the entree choice.

so, the question is, how to do that (I will be passing the RegID as the primary key from tblRegistrant to use as the linked field to tblReservations). Ideally, I'd also like some sort of edit button so people don't try to use the back browser button to change their numbers. Any suggestions?

View Replies !
Count,sort,diplay Number Of Records In MySQL Table
I am designing a search engine using PHP/MySQL and I am logging all search terms into a MySQL table. I was wondering how I count the number of occurences of a term in the table, and then sort and display the terms in descending order. For example, if the column in my table with search terms looked something like this:

clothes
casinos
clothes
homes
homes
clothes

How can I count and order the records so that I can display according to how many times they appear, like so:

1. clothes(3 entries)
2. home(2 entries)
3. casinos (1 entry)

View Replies !
Create Dynamic Table With 3 Columns And Unknown Number Of Records?
I'm trying to create a table with only 3 columns, but the problem is I don't know how many records will populate the table so need it to automatically create <tr> and </tr> tags every 3 records. How best can I do this?

At present the code below just lists every single record in one continuous row - but as I said, I want to only display 3 records per row. Code:

View Replies !
How Do I Fix This Or Does It Need Fixed
Configuration File (php.ini) Path C:WINDOWS

Loaded Configuration File C:phpphp.ini

Is this normal or do I need to do something to get the configuration file
looking in the right directory.

View Replies !
Mcrypt Fixed...
i downloaded the php_mcrypt.dll from the windows binary 4.3.2 release and copied it into the php/extensions directory (after stopping apache of course) and then the correct version of libmcrypt.dll into the winows/system32 directory.

View Replies !
[fixed] Setcookie Isn't Working
I have a login script that checks whether the information put into the form is correct, and if so it tells them, and sets a cookie, for further use. I get no errors, but when I try and echo $username (the cookie name) I get $username, and not the actual value.

View Replies !
Fixed Font Size
I making a web site where people can change the font size with a form on
a seperate page. I store the value in session-variables and read them
every time a page is loaded.

I wonder if it is possible to prevent people changing the fontsize with
Mozilla or IE menu's? Can anyone tell me more about this?

View Replies !
Fixed Size Image
I would like to change the image size to a fixed size (150 x 150), I've tried many ways but I end up with an error, this is due to my lack of coding knowledge.

<?PHP

$sql = "SELECT * FROM `seedling` ORDER BY `id` DESC LIMIT 25";
$results = mysql_query($sql);
print "<table>";
$column = 1;
while(($row = mysql_fetch_assoc($results)) !== false) {
if ($column==1) { print "<tr>"; }
print "<td>";
print "<img src="http://www.mysite.org/myfolder/";
echo $row['Bloom_Name'];
print ".jpg">"; print "</td>";
if ($column==5) { print "</tr>"; $column=0; }
$column++;
} print "</table>";
?>

View Replies !
Unpack() Fixed Length File
I'm trying to unpack() a fixed length file. Below is some of the code I'm using. I know that the file is opening, because I can display it using fread(). But when I use the code below I do not get any thing to display. PHP Code:

View Replies !
Graph When Fixed Width And Height
How to plot the graph when width and height is fixed and average is increased more than 100..... Code:

View Replies !
Add A Fixed Image (Captcha Kind)
I need to add a simple image with something like "2+2=" in order to humans filling my form type in a text field "4". I don't want a captcha but I need something similar easy to add to my form.

My php form page has something like this: ....

View Replies !

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