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 Database Base On User Choice


i want to let user delete their data from database. Note: one user may have more than one rows of data. table as following;

TCid UserName Topic Content
1 q1 aa aa
2 q2 aa aa
3 q3 aa aa
4 q1 aa aa
5 q2 aa aa

And i code as following steps;

1) ask user input user name

2) Display out all the data which the users got. (it is in delete.php file.)
in here, i will use the check box, to let the user choices which data they will delete.
note: i will try to make the Cid relate with the input name, so later on i can delete
the data base on Cid.

3) i will delete the data base on the user choice(it is in deleteR.php file).
but at the movement, i just want to test where i can get the value of the TCid or not
(because i will delete some datas base on the TCid which the user choiced).

The problem i go now, it is from the step 3, i could not get the TCid's value out,
that's mean, i could not delete some data base on the user choiced. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Give User A Choice Of Fields To Search With Full Text/Boolean?
I want to give the user the option of searching a combination of the fields $Topic, $Subtopic, $Theswords in Boolean/Full Text. The problem is if I make any of the fields empty prior to the query, I get a MySql syntax error message. The user has the option of selecting fields via checkboxes, but when the field is not selected the user will get the error message because the variable is empty in the query statemtnt.

Are there any code suggestions for avoiding the error message when a field is not selected by the user to be searched? Code:

View Replies !
Select Statement With Changing Tables Base On User Selection
I am trying to make a select statement that would allow me to change the table, base on the user selection from a drop down menu list. I don't know if its possible or my syntax is wrong PHP:

sql = SELECT * FROM "'.$_POST[Tableselection].'" WHERE  "'.$_POST[userid].'" ='1';

View Replies !
How To Use Http://www.mySite.com/test/ As The Base Domain (base Href)
how to use http://www.mySite.com/test/ as the base domain (base href)

with links relative to the site like this:

<a href="/faqs/overview.html">

Can mod rewrite do this?

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 !
Timestamp - Delete Inactive User's
I'm trying to delete inactive user's witht his code but is this wrong? Code:

View Replies !
How To Delete User In A Linux OS Using Apache
i'm using shell_exec('userdel -r $username');

but the user account still cannot be deleted from linux there.

View Replies !
Delete Uploaded File When User Exits
I've been working for this simple project. User fills out the application form (uploads a file), redirected to the confirmation page, make a payment, redirected to the payment confirmation page and then it sends an email with this file to the customer or admin. There is no user authentication so it could be anybody uploading files.

The problems is that I want to delete the uploaded file when the user exits the browser or click onto some other page when the user decides to withdraw from making a payment. Because this temporary file becomes permenant. Of course you can delete the files manually using ftp but it could be a hassle for the end user.

I've been thinking about session_set_save_handler, register_shutdown_function or connection aborted functions but none seems to work in this situation.

View Replies !
Script That Allows The User To Delete Images On The Server.
I have a script that allows the user to delete images on the server. The delete script has the server username and password in it as part of the code. This makes me nervous because if someone were to read this script, they would have access to the server and all the files Now on the server, I have .htaccess set to prevent directory browsing in the directory where the file is stored and the file the script is on is also password protected.

View Replies !
User Is Verified By A MySQL Database, And Then A Session: 'user' Is Registered.
I have a problem with sessions. In my code admin.php the user is verified by a MySQL database, and then a session: 'user' is registered.

Well when the user presses a link to a another page called news.php it will be checked if the session is the same as in the same script, or if it's even registered (to prevent people trying to break in). But everytime i redirect to news.php I get a file included ip.php wich tells me Im about to break in. Code:

View Replies !
Give User Mysql Delete Privilege For One Query Via Is This Possible?
What i'm basically looking to do is give a user delete privileges for one query only. This is just so i can keep my database clean. Am i best just writing a DB logon script for that one query only and allowing that user to delete the records or is there a way PHP can grant delete for one query?

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 Database
using php and mysql how can i tell the my website to move any entry older than 30 days to a different table and then delete it below i have some script i did try but this doesnt work (im using unix timestamp incase that changes anything)

mysql_query("
INSERT INTO newsarchive (id, postdate, title, newstext)
SELECT id, postdate, title, newstext FROM news WHERE postdate < DATE_SUB(curdate(), INTERVAL 30 DAY)");

mysql_query("DELETE FROM news WHERE postdate < DATE_SUB(curdate(), INTERVAL 30 DAY)");

mysql_close($link); //clean up

View Replies !
Recursive Database Delete
I have two tables in my database, one for the folders, where each folder has a parent id and an id itself, and one for the files where each file has a parent id for the folder its in. Now If the user deletes a folder, every file and folder within it, no matter how many there are, should be deleted. Can anyone give me the idea?

View Replies !
Delete Item From Database
I still can't figure out how to delete an item from my shoppingcart. I have tried different ways to do this, but its impossible.

-a button or link that deletes a item from my database
-the php script that deletes it

here is a suggestion:

$slett = "DELETE ID, VARE, MODELL, STR, ANTALL, PRIS,
TOTALPRIS FROM USER_TRACK
WHERE USER_ID = "$user_id"";

But how can i assign this to a button?

View Replies !
Delete Row In Database By A Selectbox?
I'm having a world of trouble with this. I have a selectbox of names....when they selectone and hit delete I want it to delete it from the database. I dont think i'm getting any value from the select box. Here is the code I have : PHP Code:

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 !
How To Delete MySQL Database.
I've got three hostings with the GoDaddy hosting service. The hostings are supposed to provide only one MySQL database each. I've just recently noticed in the phpMyAdmin program that separate databases, each with the name "test," has appeared in two of the three hostings.

I don't know how they got there. I didn't put them there. I contacted GoDaddy's technical support. They said that the "test" databases automatically comes with the phpMyAdmin program. Of course, that's not right. Anyway they said that I could delete the extra database without damaging anything.

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 !
Mark A Row In My Mysql Database As To Be Delete
Is there a way in php that I can mark a row in my mysql database and then later so delete these rows that have been marked?

View Replies !
Database Auto Count What About Delete?
I have a table that give a unique ID to certain Articles.
To give the ID i simply use the Auto count of the DB.

But what happens when i delete a record? i am now missing an ID.
How can i insert a row and give it the first available number?

For example ID 1, 2, 4, 5, 6

i would Insert and set the ID number to 3.

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 !
How To Delete Multiple Entries From Database?
I ran this script Im working on twice by accident which caused a ton of duplicate entries. I dont want to start over so how would I delete multiple entries in a database?

View Replies !
Database Update/edit And Delete
i have spent the last few days trying to create a simple script to add/edit and delete entries in a mysql database with php. i have 1 database with 40 tables, each table has 3 fields (id, header and body)

i created an input page with input fields for header and body. the table to store the information in is selected from a drop down menu. all this works fine.

for some reason i cannot get the edit and delete page top work at all. would someone mind taking a look at the code and let me know what i am doing wrong? Code:

View Replies !
Delete From Flat File Database ?
I have recently started to code a Flat file database (just for fun) and it's going fine, but I was wondering whats the best way to delete a line from the file.

I have this code below and I would like to add a delete button besides each line, which would obviously delete that line. But I do not know the best way to go around doing this as I don't know any specific functions to use. Code:

View Replies !
Using Checkboxes To Delete Record From Database
i would like to use check boxes to delete records from the database. my problem is, the records belong to different tables. how do i indicate in my code "DELETE from blah blah... " from which table to delete from..

View Replies !
How To Delete All Database Entires Older Than 30 Days?
One of the fields in my database is called ad_date which is of date type and stored dates int he format YYYY-MM-DD. I would like to perform a DELETE SQL statement in my PHP script which deletes all records with an ad_date value older than 30 days.

I knoy this is also an SQL question, but it is the 'older than 30 days' part which I'm stuck with and so figured it would be better in the PHP forum as I think I need to use PHP to calculate todays date - 30 days.

View Replies !
How To Delete A MySQL Database Table Without System()
I want to delete a MySQL table without using functions of the OS, so
that my php script can run on any webserver. Can I use a command like

$sql = "DELETE FROM tablename";

or are there better ways to do the job?

View Replies !
Simplify Insert-update-delete From Database
I'm looking for some functions or objects allowing to
select-insert-update-delete from any table in a mysql database without the
need to create a new query every time. Example:

selectdatas(array('field1','field2','fieldn'),arra y('table1','tablen'),array('left
join,idy','inner join, idx'))

then the function build the query, execute it and then return an object with
the query result.

I must build a database driven site that is 90% of the time spent on
building queries. If I may avoid build them manually it will help me a lot
and let me gain some days of programming.

View Replies !
DELETE TimeOut Issue On A Large Database
When I run the script below, it results in a timeout. Running the commands through phpMyAdmin, results in a timeout too.

Table1 has 40,000 records and Table2 has 35,000 records. I run the script to get rid of the duplicates.

Is there a way that I can check for duplicates without the timeout issue? I tried the while loop through PHP and that results in a timeout too. Code:

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 !
Choice Of IDE
I currently code everything in Notepad++ and use XAMPP as a test environment. When I used to code JSP's I had a lovely IDE called JBuilder with debuggers, code optimisation tools and class explorers with nice auto complete for methods/functions available on an object. Whilst my setup works for me I reckon that I could use a better one - what can people recommend? I'm also interested in being able to manage multiple projects at once (currently I have to swap out the htdocs folder to change projects which is a bit annoying).

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 !
Choice In A Listbox
I want to have "Other" as a choice in a listbox and when this choice is clicked then a textbox appears that allows the user to add a new category to the listbox.

View Replies !
Choice Of Recipients
I need to create a PHP form that, when submited, is sent to one of three e-mail addresses. The relevant e-mail address will be appropriated by a drop down box in the form that lists 3 different locations. I.e. If the user selects the drop down location of London as their nearest location the form will be sent to london@hotmail.com. If they select Portsmouth the form will be sent to portsmouth@hotmail.com etc.

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 !
Limited The Slection Of Choice
user can 1,2,3,4 f rom choice A. but if choses B . he can only chose 5678. if he choses C, he can only further 9,10. how can we write in php program to force such arrangement?

View Replies !
Multiple Choice Quiz
How do I create a Multiple Choice Quiz, with a back-end to allow the administrator to add, delete, edit or activate questions. The user will have the option to answer a,b,c, or d for each question by clicking on the appropriate button. The user will need to have the option to select a level out of three available levels.

View Replies !
Combobox That Limit His Choice
how can i create 2 combobox with this value:

1
2
3
4

and when I change the value of the first combobox, if the second combobox has a value great than the first it must be empty So the second combobox have to show all the value lesser or equal than the first Code:

View Replies !
Retrieval Of Choice Items
I have seen this many places and wonder how they do it. For instance, The 'vehicle' entered our campus. Here, when the user clicks the url 'vehicle', a small popup shows with choices car, truck, suv. Sometimes, the administrator can add a choice on the fly such as train or plane. How is this done in PHP or any language. Remember, a user is not shown a new screen. If possible, show me the code.

View Replies !
Choice Made In Dropdown
I'm trying to make the selected dropdown match the original choice after the page submits to itself. While doing so I some how managed to make $quantity always = 5000. Can I get a second pair of eyes on this or am i just going crazy? This first part works fine. and an example of what i'm trying to do with the second portion Quote

<select name="postcard-size" size="1">
                <option value="" >-Please Select-</option>
                <option value="postcard4-6"
            <?php $size = $_POST['postcard-size'];
            if ($size == "postcard4-6") echo "selected: selected"; ?>
            >Postcards 4&quot; x 6"</option>
                <option value="postcard85-55"
            <?php $size = $_POST['postcard-size'];
            if ($size == "postcard85-55") echo "selected: selected"; ?>
            >Postcards 8.5&quot; x 5.5"</option>
                <option value="postcard6-11"
            <?php $size = $_POST['postcard-size'];
            if ($size == "postcard6-11") echo "selected: selected"; ?>
            >Postcards 6&quot; x 11"</option>
.............

View Replies !
Programming Language Of Choice
For building Windows desktop apps, the clear favorite is C#. But my clients can't afford to buy Microsoft products. So I need to develop software for Linux users and web applications. In the open source world, what is the programmer's language of choice?

Judging by the number of members in each of these
http://www.google.com/Top/Computers...es/Open_Source/ user
groups, it looks like the top 3 open source languages are:

1. Java
2. PHP
3. Perl

Does this mean Java is the open source language of choice? Are Java apps compiled, or is it an interpreted language? What about C and C++?

View Replies !
Simple Login Page To Delete And Edit Things In Mysql Database
How do I build a simple login page on my site? I need a way to login to my admin area in my webshop, so I can add, delete and edit things in mysql database. I don't need help with add, delete and change things, only the login thing.

The users should not even know that there is a admin login page. The users don't login to shop, they just shop so I can't use the user login page because there is no such page. Can someone please give me some guidelines for this?

View Replies !
Include Large File - Right Choice ?
I've a file in wich I've almost all the text of my website. I do this
because the site is multilingual and this is easier to translate.

The file is becoming ever larger as we add new pages on our site. Actually
the file is about 100ko

I know the page is only used server side (I use a require_once) but wouldn't
be better to create a "common" file wich will be about 20 ko large (with
menus and some other text that will be always shown) and some little file
wich have the same name of the page (like index.php linked to eng-index.php)
in wich there is only the desired text for the desired page ?

What's better for the server ? would this really improve page process time ?
Or there is a way to "cache" this file in memory for faster delivery ?
(Apache server on Linux)

Has anyone a good feedback of experienced development ?

View Replies !
Fastcgi Is A Better Choice For Busy Site ?
which one you preferred for running a production, busy site?

seems PHP site only tell you to use mod_php, but seems fastcgi is a
better choice for busy site (such as Yahoo also use fastcgi)

View Replies !
Numerical Data Types, Best Choice?
After reading the manual it is not clear to me which data type I should use to store the following numbers between:

0-1000 (99% of the time will be below 100)
with a precision of 6-8 decimals

Any advice?

View Replies !
Customer Choice Assistance Tool
I'm working on a web site that sells various types of office equipment. We would like to implement a "Help Me Choose" section that asks the customer various questions like:

What is your price range?
How often do you use it?
What is your volume?
etc.

The customer can then select the answers that best fit their needs from drop down menus. Then the system will make recommendations based on their answers.

Are their any scripts out there that can assist with this?
If not, does anyone have any best practice recommendations on accomplishing this task?

View Replies !
Populate A Form Based On A Choice Made By Selection Box?
Is there a way to populate a form based on a choice made by selection box? I don't want the page to be reloaded, and I'm not sure how to do it with javascript.

View Replies !
Hex To Another Base
I am trying to find a php solution to encoding an md5 hex string into
another base.

Using ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx yz1234567890 as a
characters for a base 62
i.e.
A = 1
a = 27
0 = 62
00 = 3844
000 = 238328

This should make the hex string much shorter.

1. Does anyone understand what I'm trying to do here?
2. Has this wheel already been invented?
3. Any ideas about the most efficient way to encode and decode this kind of
thing?

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 !
Checking A Database For A User Name
How can you check a database for something. I have a database with several fields and a page for creating new rows. I'd like to make it able to search the database for one of the fields, the user name, and add a new row it the name is not present and update the row if the user name is present.

Any good ideas?

View Replies !
Add A User To A Mysql DATABASE.
what is the mysql command to create a user and add it to an exsisting database?

View Replies !

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