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 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 Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How Do I Delete Selected Rows From MySQL Table?
I am trying to figure out how to delete selected rows from a MySQL database table. The web site that I am working on has a page that will extract rows, using the "SELECT * FROM .. etc." statement from a database and output them in a table - like the one below (bottom part). I've got that part figured out.

What I am trying to figure out is if the user puts a checkmark in one of the checkboxes (below) how would I write the PHP code to delete one or two of the rows from the MySQL table? PHP Code:

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 !
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 !
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 !
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 !
Display Selected Records
I have a table on a form which contains records that can be multiple selected by checkboxes. A submit button sucessfully sends the record IDs of the checked records to the next page. I want to display the records that were selected via the checkboxes, but the problem is that I get only the first of them.

View Replies !
1 Record In Database But 2 Records Were Selected?
i'm retrieving a record from database. below the record, i have a yes and no button, where i can let user click and then count the number of yes and no.

everything works fine, but when i start to click the yes or no button, my record ,becomes two records. i only have one record in my database, but two same record was displayed.
this is the code: PHP Code:

View Replies !
Way To Pass The Selected Records To The New Page?
I have a dynamic table and use a check box in every record. I want the selected ones to open in a new page. What shall I do? I mean, what is the way to pass the selected records to the new page?

View Replies !
Show All Records For The Selected Month & Day
I have a query that shows all appointments of a chosen day using the following format:

$eventid=2007-05-21

WHERE starttime LIKE '".$eventid."%'

I have a calendar and am trying to make it show all records for the selected month, or display all records from a specific day if a day is selected from the calendar.

So far I have it where I can show records from specific day, but want selected months records as default.

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 !
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 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 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 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 !
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 !
Make Selected Option Stay Selected In A Combo After Submit
I have 3 comboboxes, one for the day, other for the month and another one for the year. Every time i select a value for the three of them and press the "Submit" button, they reset to the default option. Anyway this can be solved?

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 !
Delete From Table
I get this error not sure what's wrong?

Error: 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 'VALUES ('mortalsombat@hotmail.com')' at line 3 Code:

View Replies !
Delete Row From Table
I know that we're not really meant to request stuff, but I cannot do this script on my own. I need the bellow code to add delete links in the table so that the user will be able to delete requests. Code:

View Replies !
How To Delete A Table
I just need to know how to delete a table. Not its contents I know how to use the query DELETE FROM but how do I do the DROP TABLE one? the table name is "Events".

View Replies !
How To Auto Delete Table Row?
I Have A Page On My Site That The Database Outputs To. There Is A User That I Dont Want To Ban Yet , But I Do Want To Block Or auto Delete His Data. Now When Everyone Post New Data The Only Table That Would identify Them Is The Username Table, There Is No Member ID Table.

Now I Would Like To querry The Database And Auto Delete Table (Username) BOBBY And The Row BOBBY Posted , So There Is No Data Output To My Site Page For BOBBY. Can Someone Give Me A Couple Codes To Try, And I Would Think The Code Would Need To Be On A New Page That I Need To Make Up Right?

View Replies !
Delete A Row From A Database Table
I'm trying to delete a row from a database table.  I've made a connection yet it's not working.  Is there something wrong with the following code?

mysql_query("DELETE * from  `contactinfo` WHERE Submission_Number = 1 ");

View Replies !
Insert Into New Table And Delete From Old
I've got 2 tables of users: 'pending' and 'approved'.

The first table (pending) is a 'holding' table for unapproved users and when the user is approved I can click on a checkbox by their name and copy them over to the approved users table (INSERT INTO approved...)

This all works fine but I'd also like to delete them from the 'pending' table at the same time. How would I do this? Something like (INSERT INTO approved, DELETE FROM pending)?

I'd do a bit of trial and error but since it's on a live site, I don't want to muck it up and not be able to fix it! Code:

View Replies !
Delete Table Contents?
ive got a table thats too big to dump the records in myphpadmin, how can i dump all the fileds (i think there are 4 or 5) but keep the table and fileds intact to be used again?

View Replies !
Multiple Table Delete
I have 3 tables that all have b_id in them. Blog table has b_id, title,author,body,date then I have a tags table that has t_id,name,b_id_blog and a comments table that has c_id,c_body,c_name,c_email,c_url,b_id_blog. My question how can I remove all data from the 3 tables based off the b_id?

View Replies !
Displaying # Of Records In A Table
Can anyone throw me a link to some prefab code, or a tutorial on how I can get a page to display the number of records that meet a certain criteria.

example:
I have a page that stores information on audio FX. I'd like to include a feature that would let the users know how many items are in a particular section.

Player (10)
Items (5)
Weapons (0)
etc.

All help appreciated,

View Replies !
Counting Records In A Table
Ok, I am trying to count the number of records in one of my tables. Seems simple. BUT! its not working. It returns a 2 no matter how many records are in there.

Heres the code.

<?php
$sql = "SELECT count(*) from cam";
$result = mysql_query($sql);
?>

I would think this would work.
I have also tried mysql_num_rows, and max(), and sum()...
a little help would be appreciated, and why is it returning a 2?

View Replies !
Displaying Records In Table
I have a table that I want to display some records from my database. I have a specific spec I'd like the table to conform to, 3 cells wide.

I can get the data into a cell. But my problem is, I'd like the table to have the 3 cells fill and then have the additional data create a new rows and continue on infinately.

View Replies !
How Do I Get The Total Records From A Table?
It also shows the total submissions. Right now, when you choose to view by a particular topic (for example, select a region - California) the total submissions only shows for those results (which right now is 1). I'd like to show the total results not just for California (which right now is 4). Code:

View Replies !
Retrieve The Last 10 Records In Table
well this is my 1st post & im wondering if someone can give me the syntax to display the last 10 entries in a table for example if there are 100 records 1 to 100 i want to select 90 - 100.

View Replies !
Table Row Records For Editing
I have a repeat region of a table called userid. What i¹m trying to accomplish is being able to edit the record and then update it by clicking a submit button on the same line. I¹m doing it this way so the user can quickly update a number of records one at a time. I know I could do this by passing the userid info to a detail page but really want
to do it the way described.

View Replies !
Showing Records In A Table
I am busy with the site of the company I work for. We have a section where al our partners are mentioned. At this moment this is a static part of the website that I want to make dynamically. This is the url of the static page and how it should look like: This is the url of the dynamic page I created but it doesn't work the way that I want: This is the php code I used: Code:

<?php

$i=0;
echo "<tr>";
while (list($id, $vlag, $land, $bedrijf, $website, $email) = mysql_fetch_row($result)){

echo "<td><table>-Content with the data of the records-</table></td>";

if($i % 2 == 0) {
echo "</tr><tr>";.

View Replies !
How To: DELETE * FROM Table WHERE Greater Than 2 Week
I am building a module that displays the headline from a page that had the most hits last week. I was able to figure this out in PHP. I would now like to know how to delete and records that are over 2 weeks old. Anyone know how to do this in the mysql query?

View Replies !
Table Aliases In A DELETE Statement
Is it possible to use table aliases to shorten a multi-table DELETE statement, or am I barking up the wrong tree, so to speak?

View Replies !
Delete Something From A Table Using A String Variable.
Basically, I am trying to delete something from a table using a string variable.

$tsremove = "Available for All Windows Platforms";
$tscat = "solutions";
mysql_query("DELETE FROM techspecs_'$tscat' WHERE '$tscat' = '".$tsremove."'");

So the mysql_query should be DELETE FROM techspecs_solutions where solutions = "Available for All Windows Platforms";

View Replies !
How Do I Delete From Table After Sorting? MySQL
I want to sort column X from largest to smallest, but I want to delete all the entries from all rows after the 25th place.

View Replies !
AJAX To Display New Records In A Table
Instead of refreshing the entire page to show the new fields in a
table, I was wondering if it would be possible to use AJAX to display
the new records in a table.

For example:

Messages are entered into the DB. I use PHP to create a table that
displays the messages.

Instead of refreshing the entire page to show the table with new
messages, how can I use AJAX to show the new messages in the table
without refreshing the entire page?

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 !
Linking Multiple Records From Another Table
I'm not sure I'm even thinking about this the right way, but here goes:

I have a table of users. Each one of these users may be associated
with none, one, or many records in another table I call a todo table.
table user = 'id', 'name', 'bla bla bla','todo_list'
table todo = 'id','title','other info'

Suppose user 'id=1253' has on his todo list items 756,241, and 672. I
create a string 756,241,672 and store that string in the user's
todo_list field. Then when I want to display the todo items I get the
string with a query, bust it up into an array, iterate the array and
query the todo table.

I have a gut feeling I'm making it way more complicated than need be.
But I can't think of any other way to do it

View Replies !

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