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 Complete Forum Thread with Replies
Related Forum Messages:
Preventing Multiple Database Entries.
I am trying to make my form processor detect if an item name submitted to the database already exists I would like to display a message saying the item is already in the db. I tried something like this if ($Item_Name == "$row["Item_Name"]") { print "That item is already in the database"; } Now I know this is wrong but if someone could point me in the right direction it....
View Replies !
Update Multiple Database Entries
I want to make a quick to-do list script. I can handle entering the info, etc. What I have a question about is when I go and view the list of to-do items, once they are complete, I want to be able to mark them "Done" So I'd have a list of all the items and a checkbox for each item. If 3 of 10 are done, I'd select the checkbox for those three, click the submit button and I'd like it to update one field for each entry. So, I'd have todo_ID, todo_DONE and want to UPDATE todo_list SET todo_DONE = 1 WHERE todo_ID = '".mysql_real_escape_string($_POST['todo_ID'])."' My question is how can I do this for multiple entries all at once?
View Replies !
Using Checkboxes To Update Multiple Database Entries
I have a query that shows a list of options that a user can toggle on or off using a checkbox. query... form... while($row = mysql_fetch_array($result))... <input name="menu_show_attribute[]" type="checkbox" class="checkbox"'); if ($row['menu_show_attribute'] == 1) { echo (' value="'.$row[menu_id].'" checked /> } else { echo (' value="'.$row[menu_id].'" />'); } The list is generated from boolean values in a DB. This populates my form with checkboxes, some are checked and others are not. I'm using an if statement to sort it (checked). This works fine. The problem is when the user un-checks a checkbox, the value does not get passed and the DB does not update - set/change it to 0. The only values that get passed are the checkboxes that are checked. Below is the query / code after the submit button has been pressed. Are radio buttons the answer? Any help / suggestions would be very much appreciated. //process form for ($i = 0; $i < count($menu_show_attribute); $i++) { if (isset($menu_id) == 'checked') { $menu_show_attribute = 1; } elseif ($menu_show_attribute != 'checked') { $menu_show_attribute = 0; } $query = 'UPDATE menu SET menu_show_attribute = "'. $menu_show_attribute.'" WHERE menu_id = "'. $menu_show_attribute[$i].'"' echo("<br>"); echo $query; $result = mysql_query($query, $db) or die(mysql_error()); }
View Replies !
Database Design For Multiple List Meny Entries
I have a database called nottsvcs with a design as follows: refno (primary key) organisation (char50) telephone (char50 activities (list menu)** My list menu of activities allows the user to pick more than one activity. My question is how do I change my db design to allow for storage more than one list menu selection?
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 !
How Do You Delete Entries From ODBC
i have an Access Database that i can read and write to no problems however, when i try to delete an entry it all seems to run with no error but the record never deletes!!!!! The '$_POST[id]' is from a previous page. Code:
View Replies !
Delete Entries 1 Week Old Or Older.
I have a query that's supposed to remove bulletin entries that are a week old and over, but its not working, and the "date" column is filled with "time();" <?php mysql_query("DELETE FROM `bulletins` WHERE `date` > (time() + (3600*24*7))");?>
View Replies !
Getting Multiple Entries
I am executing a query when someone searches on my website, I am saving the search terms to see what if anything is being searched for most of the time. I have this code on my search page @include_once('/home/nsbsports/public_html/scripts/save_search.php'); //saves search terms this is the code I am using to do the actual insert query with require_once('connectdb.php'); $term = $_GET['aaa']; $form = "d F Y"; $date = date($form); $save = "INSERT INTO search_history (search_terms,date) VALUES ('$term','$date')"; $res = mysql_query($save); when I look in my table the same search_terms have been saved 2 or 3 times for each query. Any ideas?
View Replies !
Multiple Blank Entries?
When I go to my secondary page of results after I fill info out on a form on the first, I get 3 blank entries automatically inserted into the mysql tables. This second form has these blank entries printing up each time even if I go in to the second page w/o filling out any info on the first. Is there a way I could prevent these blank entries from being automatically entered? Like some code that says that if something is blank then not to have it entered into the tables? or something easier?
View Replies !
Multiple Entries For Same User?
I am creating this form, and instead of having a huge list of input boxes for visitors to fill out, I am wondering if it is possible to have the user click on add another button, and a new submittion will be added to that persons file.
View Replies !
Select Multiple Entries
I attach a List Box Control, on a form. It has total five values i,e a b c d e I want that when my page loads, then entry no.2 (b), and entry no.3(c) are selected by default. How can i do this. give me the code.
View Replies !
Multiple MySQL Entries
I want to have two mysql entries in on variable $sql = mysql_query("Query Here"); but I want to run two seperate queries at the same time for example, inserting info into two tables in the same variable.
View Replies !
Adding Multiple Entries
I currently have a form that adds data into a mysql database. What I would like to do is submit a duplicate entry as many times as specified in a "quantity" box. Pretty much I want the user to specify how many of the same record he would like to create.
View Replies !
Inserting Multiple Entries
I'm trying to built a page for referring uses to a web site, I've used a simple php loop to loop the input box for email address ten times, I've set the names as so: name='Email<?=$i?>' so that every name is different.
View Replies !
Use Checkboxes To Take Multiple Entries
I'm basically trying to create an email system which will allow my colleague to select jobs from a list using checkboxes which will then populate a textarea for formatting, then be sent out in an email. Not looking for too much code here, just a couple of snippets to point me in the right direction I can create the listof jobs and add checkboxes, I'm just not sure where to go from here. Having browsed the forums I'm guessing a foreach() loop would be called for, but I'm not sure how to get the multiple values from the checkboxes into an array, and from there how to put them in a variable to put into a textarea.
View Replies !
Multiple Entries In On Column/List Box
I'm creating a page where members can edit their research information. I'm going to have 12 List Boxes, each with about 20-25 words. I want the user to be able to choose as many as they need (by control+click) - and store them all in the database. I expect each member to only have about 4-5 .. but you never know. The information they submit, all 4 or 5 or however many keywords, will need to be easily searchable on the main page. I also am going to need to make it easy for them to edit/update their keywords. My question is - which is the best way to do this? Do I dumb all the selected values into one column of a table? then when doing a search just do a text search? And how do I implement the update page? I know how to show previous text in a text form field, but is there a way the options they chose can be pre-selected when they go to update their research?
View Replies !
Adding Multiple Entries With One Click
I've written a form in html and use php to process it to my database. What I want to do is make it so that a person can choose a number and then by clicking submit it will create an amount of db entries that corresponds to the number that they chose.
View Replies !
Logging Multiple Checkbox Entries
I was trying to make my software script be able to validate the checkout process of multiple software entries. I also have it that when the admin validates the request to check out software that it will be logged in a seperate table. I can't seem to get it to work. When I look at the database software_logs table I'll see the entry is mostly "Array". Here's the code:
View Replies !
Parse Multiple Entries On A Page
I'm trying to parse multiple entries on a page, i've managed to get it working for the first entry, but can't seem to figure out a while statement that will run through all the entries on the page: Code:
View Replies !
Dynamic List Has Multiple Entries
On an input form there is a dynamic drop down list to select from a dozen different categories. The form inserts correctly into the database. The problem is that every time a category is selected the drop down menu list it an additional time. For example if the list has: apples, pears, oranges. If pears is selected the drop down list will display: apples, pears, pears, oranges. Code:
View Replies !
Multiple Blank Record Entries?
I keep getting multiple blank records entered along with my data everytime I submit my form. On the first page is the form itself without any code. On the 2nd page that it goes to after I hit submit is this: Code:
View Replies !
Multiple Entries In A Field Enquiry
I'm just after a little bit of guidance really. If I have a field in a table, is it possible to have more than one entry in that field and seperate them by either a , or a ; or something like that? For example:- Field 1 - graham Field 2 - david, bob, ian, nick, robin Field 3 - simon What I am aiming to do is have field 2 as a link through to a search page which searches on whatever name you click on so if you click on david it will bring up a search page listing all the pages with david in or if you click on bob it will bring up bobs pages. Hope that makes sense, is it possible to do ?
View Replies !
Refreshing Page Making Multiple Entries
I have a form which accepts input from the user and then inserts data into mysql. The problem is, after user inputs data and a new page is loaded; if the user again presses "refresh" button, the same entries are re-entered into database.
View Replies !
Sorting DB Entries Over Multiple Pages (and Columns)
I am making an image gallery, and have previously had problems sorting the database entries over several columns, that is now sorted. However, I don't know how to make the entries on page 2 to begin from image 10, page 3 to begin from image 19 etc (given that I am using a 3x3 table so 9 images per page. Here is the code that prints the URLs of the images (i am working with text, rather than IMG tags until it works): PHP Code:
View Replies !
Populate MySQL With Multiple Text Box Entries
I have about 300 rows of mysql data which I have chosen to diplay with a text box at the end of each row, that is available for adding comments. I would like to be able to add comments to entries and then have an update scripte that would take the text box, named "MC" and place the data in its row identified by a hidden field which would corrrespond to the Primary Key of the MySQL Database. I've done something similar using check box arrays, ie. Checkbox name="MC[]" My question is whether I can write a script that would test for a value in the corresponding text box, and update the MySQL data accordingly. I have also provided in my display script that if the MC column is already populated in MySQL it will not display in the form.
View Replies !
Checking For Multiple Entries In Exploded Array
Problem is this, trying to use multiple values from an exploded array to update rows. Currently if there is more than one duplicate value in the array the update only processes the first one, any remaining duplicates of the same value are ignored.. I need to be able to update all values inside the array, duplicates as well. Any ideas how to make this happen? Maybe if the form could check for multiple entries and handle them differently?
View Replies !
Form To Update Multiple Entries In A Mysql Databse
I am trying to create a form to update multiple entries in a mysql databse. This code below is rough, but it is working to the point wher it pulls the data, displays it in the text areas (but it does not go past the first white space in displaying, that needs to be fixed), and then I can alter the text fields, check a box, and hit submit, and it will update the fields, but the new value is size=20. I also can't update more than one record at a time, which defeats the purpose. Any ideas?
View Replies !
Extracting Database Entries
I have a non-profit's web site that wishes to allow their members to fill out information regarding summer camp information (name, contact info, mailing info, physician's name, etc) online and submit it. I can handle taking the info with PHP and putting it into a mySQL database easily. But what has me stuck is that they want the ability to print out hard copies of selected submissions (their choice) if they need to. Would I have to display all the database entries in a form on a new page with a select box next to each entry and have them pick that way, then loop through and print out the selected ones or is there a better, more direct (read: easier) way to accomplish this? Does this sound like something for which there may be a pre-written PHP script that can be altered?
View Replies !
(PDO) Database Entries Are Not Possible, Even Without Errorfeedback!
I am trying to insert with PDO-Sqlite rows through a form. I can do whatever I want, I don't find the sollution where I made the error. Perhaps somebody of you could help me?! However, the database is created with sqlite, and the entries should be done with PDO_SQLITE. However, no entries are done anyways and I am one step going nuts, specially because I don't receive no warning or errormessage on the screen. Code: <?php require_once('HTML/Form.php'); require_once('I18N/UnicodeString.php'); require_once('HTML/Table.php'); class Formular { private $ServerVar = array("Auswahl","Betreff","Eingabe"); function __construct() { $this->ServerVar["Auswahl"] = $_GET['Auswahl']; $this->ServerVar["Betreff"] = $_GET['Feld']; $this->ServerVar["Eingabe"] = $_GET['Eingabe']; $this->MeinFormular(); //$this->sqdb(); if(($this->ServerVar["Betreff"] === null) or ($this->ServerVar["Eingabe"] === null)) { $this->MeineDB(); $this->TextFeld(); } elseif (($this->ServerVar["Betreff"] === "") or ($this->ServerVar["Eingabe"] === "")) { $this->MeineDB(); $this->TextFeld(); } else { $Auswahl = $this->ServerVar["Auswahl"]; $Betreff = $this->ServerVar["Betreff"]; $Eingabe = $this->ServerVar["Eingabe"]; $this->MeineDB2($Auswahl,$Betreff,$Eingabe); $this->TextFeld(); }
View Replies !
Edit The Entries In The Database
I have a script that allows you to edit the entries in the database. All is working fine except when you pull up an entry for editing the subject field only prints out the first word of the subject??? I know the entire subject line is in the database, but only this part of the script won't print it out. All the other fields work fine. Code:
View Replies !
Limit Entries In Database?
Im using a guest book script that uses a Mysql database. Id like to limit the number of entries it will save in that database to say, 100. I emailed the fella who wrote the script and he replied with: Just make a simple if the id is bigger than 100 or how many entries you want ... then just redirect to the index page. I dont know a whole lot about PHP although Im learning and this is what Im trying which isnt working. if ($id > 100){ echo "<meta http-equiv=refresh content=1; url=http://www.mysite.com/blah>"; }
View Replies !
Comparing Database Entries
I have two table in a database, one with products one with reviews. The reviews are linked to the product via a unique id but I'm looking to write a script which can see if a product in the database has been reviewed or not but I hit a "coders block" . I was going to use a loop to see if the id in the review table matched any in the products table but I would prefer the script to only show the ones which haven't been reviewed and so that would not be the best way since it would chuck out a 'False' every time it didn't match up.
View Replies !
Show Last 5 Database Entries
I just set up a database with tutorials (id, title, description, image, url, cat) id is auto_increment, so the highest id should always be the last tutorial. I want to show the last 5 tutorials on a page, so I tried to use this: PHP Code: <?php include("connect.php"); $sql=mysql_query("SELECT * FROM tutorials ORDER BY id DESC LIMIT 0,5") or die(mysql_error()); $x=0; while($row=mysql_fetch_row($sql)) { echo ($x+1).') '.$row[title].'<br />' $x++; } ?> But I got this output: 1) 2) 3) 4) 5)
View Replies !
Counting Entries In Database
I have a database with various fields... one of them is "region" REGION r1 = Scotland r2 = North East r3 = North West etc etc then on my html/php page i want to list the regions, then in brackets add how many entries there are in the database for that region. Scotland (?) North East (?) etc etc The question is how do I count how many entries for each region and then show the result.
View Replies !
Deleting Old Database Entries
I'm trying to make a code that searches a database to check for entries that are 3 months old and then erase them. My problem is that I got no idea on how to make a variable that checks the current date so that I might compare it with the entry date, and also how should I make my If or While loop so that it works, I mean it's obvious that it must compare the two dates but how do this.
View Replies !
Don't Display Duplicate Database Entries?
I have a restaurants database that has a lot of restaurants listed with the same name in the same city with only the category changed. This is the code that I have that displays the list of restaurants. Can someone tell me what to add to it so that it will only display one of each restaurant of a certain name? PHP Code:
View Replies !
Output Database Entries In A Table
I'm trying to display the entries in a table of two columns, one entry per table cell - in other words, two entries per row, number of rows based on number of entries in the database. But it still doesn't seem to work. It displays one entry per row... I don't know where the problem is. Here's my code:
View Replies !
How Do I Display All Database Entries Between Two Dates
I have two dates in a form " startdate" and enddate" when i display the results i would like to show all results between, and including the two dates. how do i do this... this is my current query: My Variables: $userid = $_GET['idr']; $fromdate = $_GET['fromdate']; $todate = $_GET['todate']; The query: $result = mysql_query("SELECT date, status, time, notes FROM timeclock WHERE userid='".$userid."' ORDER BY time");
View Replies !
Getting Form Entries To Mysql Database
Here's the scoop after 2 days of screaming profanities at my monitor I need Help... I built a web form looks good but worthless...I also set up a msql database with a table and all the rows I need using mysql admin also worthless unless I get the entries from the form to save to the database. I have tried a hundred different scripts and variations thereof. Warning I am a real estate agent not a computer whiz so the php and mysql documentation is like reading a dead language the jargon is useless to me....
View Replies !
Splitting Articles / Database Entries
Sometimes when I read websites they split their articles over multiple pages. Now that I'm doing my own site I'd like to do this with my lengthier articles. What I want to know is how people would approach this with respect to the PHP/mySQL side of presenting the information? How would you decide how many pages to split the article into and how would you actually split it so that the user can click page 1, 2, 3, or n ?
View Replies !
INSERT Adding Too Many Entries To Database
I have the following code to add an entry to my visitors table to track referers and what pages they visited, etc. $sql_ref_update = "INSERT INTO visitors (refdate, referer, refpage, refip) VALUES ('$refdate', '$referer', '$refpage', '$refip')"; if(!mysql_query($sql_ref_update)) die(mysql_error()); I just found that when I do this, where I expect one entry to the databasae, I'm getting three (two of which have are the same IP). I'm assuming that the second IP I'm getting might be a firewall or caching server but why two entries for the one IP on one visit? UPDATE: I found that one of the IP "visitors" is caused by the Google toolbar being on. I didn't know that the toolbar counted as a referer. Why is this? Is this well known because I didn't know about this until now.
View Replies !
Getting Data From Database - Entries Not In Right Format
I am running an online job search site and employer are able to post their job vacancies under multiple categories. Example - Accounting,Administrative,Hospitality The example above is taken from the category table in the database. The problem is, I am trying to create a script that lists al the jobs available in each category and its not listing the jobs that employers have selected multiple categories, its only listing the jobs that have been added into only one category. Code:
View Replies !
Save The Checked Entries To Database.
I have checkboxes in my script and i need to save the checked entries to my database. i made the checkboxes an array. the problem is, when i try to print the array, what prints is the name of the array itself and not the content of the array. here's the code: $check_entries=array(); $check_entries=$_POST["check_entries"]; $check_count = count($check_entries); print($check_count); for($a=0; $a<$check_count; $a++) { print($check_entries[$a]); } output: check_entriescheck_entries.
View Replies !
Skipping Database Entries Using A Loop
I am using this code to read from a paper database and display the result in a dropdown menu in out website. What I am trying to do is skip the entries that have the resolution field less than 2880 (elseif($paper_types_4800[$x+5]) < 2880 in the code below). I've gotten it to just echo blank spaces in the dropdown menu but they can still be selected and submitted. How to I skip these entries entirely in the dropdown menu? Code:
View Replies !
Archiving Versions Of Database Entries And Diff
I'm looking to change a database application so that when users make changes, a certain number of versions get archived so that users could potentially see previous versions and, preferably, get some diff output. The goal is really to version one large text field, though I would probably archive the entire record from that table. Code:
View Replies !
|