Delete Issues MySQL 4.0.25-standard
<?
include("../../includes/global.inc.php");
mysql_connect($glob['dbhost' ],$glob['dbusername' ],$glob['dbpassword' ]);
@mysql_select_db($glob['dbdatabase' ]) or die( "Unable to select database");
$query = "DELETE FROM testimonials WHERE id LIKE '$id'";
mysql_query($query);
echo "Record Deleted";
mysql_close();
?>
<META HTTP-EQUIV="refresh" content="0;URL=admintestimonials.php">
the issue is that it is not deleting the record. the $id is an echo from another page. I can see that it is echoing the id number just does not delete the record. any ideas?
View Complete Forum Thread with Replies
Related Forum Messages:
MySQL Industry Standard
I am a MySql newbie, and have been using phpMyadmin to manipulate the databases I create. I would like to know if there is an "industry standard" for setting up a MySql DB. Is using an interface like phpmyadmin considered an acceptable practice, or should I only use MySQL commands typed into the command line? Does it really matter? Is this the equivalent of typing HTML and CSS instead of using a WYSIWYG?
View Replies !
Standard Mysql Queries
I'm familiar with standard mysql queries. but his one is a little advanced for me. can so one decipher it. "SELECT o.*, u.username FROM myauction o, myauction_users u WHERE blah blah blah blah blah...
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 !
Standard Mysql Queries - Warning: Mysql_select_db(): Too Many Connections
This is what appears on my site when there: Warning: mysql_connect(): Too many connections in /home/public_html/ca/sjsu/includes/settings.inc.php(2) : eval()'d code on line 12 Warning: mysql_select_db(): Too many connections in/home/public_html/ca/sjsu/includes/settings.inc.php(2) : eval()'d code on line 16 Warning: mysql_select_db(): A link to the server could not be established in /home/public_html/ca/sjsu/includes/settings.inc.php(2) : eval()'d code on line 16 What's going on?
View Replies !
Mysql Issues
First off I'm not sure if this is a problem with php or mysql. I am asking it here because I am using php to pull the data. Code:
View Replies !
Php / Mysql - Updating Issues
I have a custom shopping cart db that has a product table, category table and a producttocategory table. The product table has a ProductID (auto_increment) The category table has a CategoryID (auto_increment) and the producttocategory table has a ProductID and a CategoryID, this is so products can appear in multiple categories. It also has a ProductToCategoryID (auto_increment) I have also begun creating and Admin site, I have created the "Add a Product" page, this allows the user to select multiple categories from a list of available categories and when "Saved" updates the producttocategory table. The problem I am having is with the "Edit a Product" page. When they edit a product they see the current list of categories the product currently belongs to, and they can "Add" or "Delete" any of these, but the problem I find is that to accurately know if a category has been added or deleted is to, everytime the "Save" button is clicked, delete all the entries for this product from the producttocategory table and re add them... most times a product is edited the categories wouldnt be changed, but I still have to perform this routine to make sure... so if a product is edited often I am rapidly going through ProductToCategoryID's... now I could just set the ProductToCategoryID data type to be int or larger, but this seems wasteful... my question is... IS THERE A BETTER WAY???
View Replies !
Apache Win32 + Php + Mysql Issues
i've just recently reinstalled windows, and i'm having a very bad problem with apache (win32) + mysql + php. For starters i installed everything like normal. Apache v. 2.0.50 PHP v. 4.3.8 Mysql 4.1.4Gamma I then installed phpmyadmin, i noticed it was having a problem connecting to the database, citing an incompatible/outdated client. I looked up some infos in the documentation and it told me to check the version of the php api by calling phpinfo(); Client API version 3.23.49 Why is it only 3.x? Shouldn't it be 4.xx.xx? Is this the reason phpmyadmin won't work? How do i fix this? btw i've deleted all occurances of libmysql.dll and still have the same issue.
View Replies !
Windows / Linux MySQL Script Issues
My scripts work fine on my linux box at work, but when I move em home, they still work fine but at the top of every page i get this message Warning: Cannot send session cookie - headers already sent by (output started at c:apachehtdocs ussell ealestate es_det.php:6) in c:apachehtdocs ussell ealestate es_det.php on line 9 Warning: Cannot send session cache limiter - headers already sent (output started at c:apachehtdocs ussell ealestate es_det.php:6) in c:apachehtdocs ussell ealestate es_det.php on line 9 Is there something you have to change/add in PHP scripts working with a MySQL db in windows?
View Replies !
Excel To MySQL Etc Character Encoding Issues
We have an MS Excel spreadsheet from a client with tens of thousands of cells imported into a MySQL database. As one would expect the Excel sheet has a lot of characters in it that don't get converted to the standard latin character sets very well. What I get is a lot of extra characters around things like fractions, degree signs, bullet points, etc - most the letter A with a cap on it, but any time I try to do a str_replace() on it, nothing happens - the extra characters are still there. For example, if I try to replace the capped A with a fraction after it with the equivalent HTML character code, I just get a capped A with the html equivalent after it (looks exactly the same). I imagine what we should have done is create the original DB in CP1252, done the import, then go through and convert all the tables to Latin1, but we're kinda beyond that at this point in the game.
View Replies !
MySQL Date, And Time Entry Issues.
Just a few quick questions about date and time entry using html. What are the preferred methods of entering time data into a database. Eg, using two drop-down lists. And also, can anyone suggest a good date picker, or a datetime picker.
View Replies !
Performance Issues With Frequently Closing/opening Mysql Connections?
I have been faced a couple of times with the situation that I wanted to write a script and was worried about a too frequent opening and closing mysql connections. To give some examples: 1)I am trying to develop a photoalbum (also posted a topic called "array / mysql question"). Of course I can use some wonderful open source albums but at the same time I want to get more familiar with all the ins and outs so my idea is a list of filenames, where the database connection should be opened, a statement like"select filenames from photos" , and, every filename maybe with a thumbnail is a link to a second page and the whole is followed by closing the connection. The second page could be something like opening the database connection, a statement like "select description ( and other fields) from photos where filename = $filename" , and closing the database again. Let's say the visitor looks at the picture and its description, clicks on a link to the first page with the thumbnails and agin the connection is opened and closed to execute the first select statement, the visitor chooses another picture etc. etc.... 2)On the left column there is a menu item "activiteiten". when there are special activities like a music performancein the near future they are shown below that menu item. A select statement is done where the first announcement date, and the last announcement date are checked and the records where the current date is between those values are selected (and shown in the menu bar of course). Again the connection is opened and closed again immediately after the select statement. However, this query is stored in "header.php" so on every page that is visited, the connection is opened and closed. It would also be nice to make a link on the "one-photo-page" to the previous and the next photo, which leads again to the open-select-close "ritual". I am not really a php guru (but not a newbie either) and unfortunately I could not find many info on google about the performance issues that can be involved when I decide to write such scripts. There were some vague indications that it is better to open and close a connection frequently than leave it open too long in order to execute more queries but I could not really find good documentation about it. I also thought to store the results of the query into a session variable but I am not sure about the performance issues of sessions either.
View Replies !
Mysql DELETE
im a stuck again, could some one please tell me why this dosent work; mysql_query("DELETE FROM messages WHERE from='$fromid', sento='$myid'");
View Replies !
Delete For MySQL
I'm an experienced java/C++/SQL programmer who hasnt used PHP. I'm looking for some generic database access pages for doing dds, edits, deletes, etc., hopefully with some error handling. I'd rather start with a basic shell of code, so I don't have to reinvent the wheel, and can just change connection string, database fields, etc.
View Replies !
Delete MySql Row By Date
Can someone help me with the following problem: I have a table that includes a column for "last application date", let's simply call it "date". Now the problem is how to automatically delete rows where the information in the "date" column has gone old, let's say by -86400 (1 day). Example: today's date is April 11th, which means that all rows with the info April 10th in the date column would get deleted.
View Replies !
How Do You Do A CASCADE Delete In MySQL?
I'd like to delete a record and all its children records at one time. How do I do that? Can you, in one SQL statement, delete from table 1 where id = 3 delete from table 2 where id = 12 delete from table 3 where id = 12 ......
View Replies !
MySQL - Delete Across Two Tables. OT
i cant find the MySQL newsgroup, however i am hoping to pick up on some expert advice from php/mysql gurus here. I'm having some trouble performing a delete across two tables. The tables i have are: questionnaires (id, name); questionnaire_questions (questionnaires_id, id, name, qf_type) The questionnaire_questions table contains a list of questions for a specific questionnaire (indicated by the questonnaires_id). I would like to remove a questionnaire, and when doing so all corresponding questionnaire_questions who have matching id's (questionnaires.id = questionnaire_questions.questionnaires_id). I have this statement, however it only works if a questionnaire has questions... however i would like it to delete even if no questions exist for that specific questionnaire. The SQL i am using is: delete questionnaires, questionnaire_questions FROM questionnaires, questionnaire_questions WHERE questionnaires.id = questionnaire_questions.questionnaires_id AND questionnaires.id = THE_QUESTIONAIRE_TO_DELETE_ID
View Replies !
DELETE Problem With MySQL
I've been learning using PHP and MySQL from the tutorial at freewebmasterhelp.com. Everything works fine, except deleting things. The script is invoked with a URL like this: http://www.example.org/test/delete_entry.php?id=35 And here's the script: <? include("dbinfo.inc.php"); $id = $_POST['id']; mysql_connect($server, $user, $password); $query = "DELETE FROM test1 WHERE id = '$id'"; @mysql_select_db($database) or die("Unable to select database."); mysql_query($query); mysql_close(); header("Location: entries.php"); ?> The dbinfo.inc.php file defines the variables $server, $database, $user and $password. The login part works.
View Replies !
Mysql Delete From A Form
i'm trying to find out how to get this to work. You type in a name of a record in the database and it removes it. In this case it's deleting the record that when you type in the name of the server it looks for it in the column "servername". You type in the servername and it will delete the whole record. Code:
View Replies !
MySQL MultiTable Delete...
I've been able to delete rows from one table successfully but what I want to try next is giving me some problems. I have a users 'id' which is unique. Heres what I want to-do. DELETE * FROM users WHERE id = 1 DELETE * FROM messages WHERE from = 1 DELETE * FROM comments WHERE user = 1 In each table there oginizaed a little different hense the id , from & user... but thats what I want to-do, without having to-do them all sepreatly, would like it to be efficent. the users ID will be passed along as the var 'id' any thoughts? So pretty much it takes the users id number and deletes them from each table.
View Replies !
Mysql Delete Record
when I run this code below it doesn't delete the record or display any error message $id = $_GET['id']; include("../dbconnect.php"); mysql_query("DELETE FROM promotions WHERE id='$id'") or die(mysql_error()); Such a simple thing to do but I don't no why it doesn't work
View Replies !
How To Delete Only Certain Text In A Mysql Row?
I have a table setup that has a column setup as friends and users can add friends to this column no problem. What I would like to know is how to delete only certain parts of the text of the row/cell where their friends are stored. The friends text is seperated by the following : " , " That is a space on either side and comma in the middle of the space. I know how to explode the results and put into an array to display the reuslts, but is there a way to delete only one of the friends if the text is as follows. , thomas , frank , irene , I think you can get the idea. Is it possible to do this or should I just update the whole cell without the array[$i] result being the friend?
View Replies !
PHP Unlink() & Mysql Delete
Im trying to delete a file, then delete the row in my table that holds the info for this file. I tried the code below and got this error: Parse error: parse error, unexpected T_STRING in /nfs/cust/4/97/13/731794/web/Admin/backup/PXS_DeleteBackup.php on line 34 Here is my code:
View Replies !
Mysql Row And File Delete
I have a database with the following colums, imageID, imageName, imageDesc, imageFile, imageHeight, imageWidth, imageThumb, imageThumbHeight, and imageThumb Width. I can easily delete a row from the mysql table, galImages, but I also want to delete two files from a directory. The file names are stored in the columns imageFile and imageThumb.
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 !
Mysql Query : Delete From *
When I use phpmyadmin, and run this sql query, it will tell me that it affected X amount of rows (lets say 10). However, when i run my script, it doesnt' tell me that. Code:
View Replies !
Delete Duplicates In MySQL
I have a database in MySql which has 2 fields. The 1st field is called id which is the primary key. The 2nd field is called full_add where there are some duplicates. I would like to delete all the duplicates in the full_add field leaving only 1 record behind. It does not matter if the corresponding primary key gets deleted as well because the primary key is not related to any other table or database. I prefer not to use temporary tables or create new tables because my webhost does not allocate much memory to me & my database is quite big.
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 !
MYSQL/PHP Delete Script
Im having problems getting my delete script to work it comes back with: Delete Error: Unknown column 'EVANS' in 'where clause' so it is using the surname i input as the column name but why?
View Replies !
Php/mysql Insert, Update, Delete All-in-one
I have a check box form in an admin area, that links various related tables into one. These check box results are stored in an array, and then looped, there are in fact four groups of arrays, but the array length could become large (i.e. dozens - not hundreds) The issue I have is that from the one form multiple things need to occur. - If a box is checked and the record doesn't exist a new record needs to be inserted. - If a box is checked and the record does exist, it should be ignored (as it already exists). - If the box is unchecked and the record exists, it should be deleted. - If the box is unchecked and the record doesn't exist it should be ignored (the record doesn't exists). I'm looking for the logic and process (rather than being hand fed code ) Can this be done with 1 (or more likely 2) sql statements. Or do I have to loop thru the arrays, checking the existance and then applying a specific sql statement depending upon checked status and the records existance. Someone mentioned using IF() in the sql statement, but I am not familiar with that one.
View Replies !
Delete Row From Mysql Only Deletes The Contents?
mysql_query("DELETE FROM cart WHERE ItemId=$ItemId"); There is the code but the result in my databse is that the ID number changes from, lets say, 77 to 78 with 78's contents being empty. Therefore when I look at the results - the deleted ID77 is gone but now I have ID78 with no content! Does anyone know why and how do I make it stop?
View Replies !
MySQL DELETE: How To Get Page To Refresh?
I have a script that deletes records in a table. It works fine. However, it redirects the browser back to the page and the record stills shows there. Only after the page is manually refreshed does it disappear. I've used both header("Refresh...") and header("Location...") to accomplish the redriect, but no dice. The only thing that seems to work is if a unique URL is pushed into the address bar, which I do by appending md5(microtime()) to the end of the redirect URL.
View Replies !
Select & Delete Mysql Queries
i've try to insert and delete record at the same page, but it only can insert and can't delete the record. when i click submit button from the previous form, the record is insert into table B and delete from the table A. is the code correct? Code:
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 !
MySQL Delete Only Deleting Content
I am working on a content editor for a client who wants tha ability to add new page. But he also has to be able to delete page. The pages are refered by their PID column which is set to auto increment. However, when I delete a row, for some reason, it deletes the content in the row, but not the row itself. So, I have an empy row left which gets assigned a PID when I drop the PID column and reconstruct it with the new auto_increment numbers. What could be causing this? Or is there a way to renumber the auto_increments after a page has been deleted? My coding is a little rusty right now as I am out of practice. had to have a reference manual by my site at all times. PHP Code: $sql     = "DELETE FROM $db_table WHERE PID = $id LIMIT 1"; $result = @mysql_query($sql, $db_connect) or die(mysql_error()); $drop     = "ALTER TABLE $db_table DROP COLUMN PID"; $result = @mysql_query($drop, $db_connect) or die(mysql_error()); $add    = "ALTER TABLE $db_table ADD PID INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST"; $result = @mysql_query($add, $db_connect) or die(mysql_error());
View Replies !
Time Limit To Delete From Mysql
on my site i allow users to upload .doc, .pdf and image files, over time these files will build up on the server and take up a bit of space, i was thinking of adding a "clean up" button in the admin section where files/users older than a certain time are deleted from mysql and the files (unlinked) can anyone advise me on the best way to acomplish this. i know i need to query the database then find all files uploaded (say after 28 days for example) is that on the right track or is there another way at all?
View Replies !
Delete Textfile List From MySQL Table
I have a list of email addresses that I need to delete from my database and they are in a textfile, one on each line like below... a@b.com c@d.com e@f.com etc. does anybody have a snippet of PHP code that I could use to accomplish such a task?
View Replies !
PHP File To Delete Multiple Talbes In MySQL
i installed PHP Nuke, didnt really like it. I think its much more then what I need. Great System, just think alot of it is useless for my needs. In any case i want to delete all the tables it created in my DB. Anyone got a script I can run to delete all tables that start with.
View Replies !
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 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 !
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 !
Delete Query - Error In Your SQL Syntax; Check The Manual That Corresponds To Your MySQL Server
I have tried to make a delete query but it won't work it gives me a syntax error but I'm unsure where i have gone wrong.... this is what i have got at the moment: Quote$Deletesoldhouses = "DELETE * FROM soldhouses WHERE SoldHouseID = '$HouseID'"; mysql_query($Deletesoldhouses) or die(mysql_error()); Can any one see what i did 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 '* FROM soldhouses WHERE SoldHouseID = '1'' at line 1
View Replies !
|