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 Complete Forum Thread with Replies
Related Forum Messages:
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 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 !
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 !
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 !
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 !
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 !
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 !
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 !
Commands To Delete, Recreate And Repopulate A Table
I am in the middle of an assignment at uni which has lots of tasks which will eventually create 4 different dynamic pages. On one of the pages, I need to create a script to open a file containing MySql in it. The MySql has commands to delete, recreate and repopulate a table. I currently have; $handle=fopen("filename" , "r"); $lines=file("filename"); but I'm not entirely sure where to go from here.
View Replies !
Multi Table Insert Delete Select Function Needed.
I am going nuts here and I know with all the functions out there, there must be an easier way to do this. Maybe someone can point me to the right tutorial or even show me how to do this. I have a $main_id and many $sub_id tables and like to “SELECT to view” INSERT and DELETE those. UPDATE must not be but would be nice. Here is how it looks:
View Replies !
Listing Table Data With An Option To Delete Each Individual Item.
Was wondering if anyone could help me with a PHP, MySQL problem. I am completely new to PHP and MySQL. I have been trying to find a way to list data from a table on a web page and after each individual item have a hyperlink to allow users to delete the information listed. Can anyone help? i.e. Name Age Sex ------------------------------------------ Adam 21 M delete Betty 22 F delete Chris 23 M delete Daisy 24 F delete ------------------------------------------------------------------------------------------------------------------------------ (delete after 'Sex' would be the hyperlink to delete that entire line (row) from the table).
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 !
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 !
Grab Content From HTML Table And Place Into MySQL Table?
I am in the process of helping a co-worker upgrade some of his old static html pages into dynamic MySQL driven pages. He currently has a lot of pages with huge tables displaying data. Does anyone know if there is a script or class that can convert a table to a .sql file for upload?
View Replies !
Table Background Color Based On Results From MySQL Table
I am trying to get the "Did User Agree" field on a database query to be colored Green for "Agreed" Red for "Disagreed" and Blue for "Agreed (2nd Time)" .. I have my PHP setup to do the query just fine as of right now with alternating column colors, just can't seem to get the colors to work as I am hoping for. Can anyone help me get the Agreed? table's background color to the colors above? Code:
View Replies !
How To Select Count From 2ndary Table On Matches In Primary Table?
I'm coming back after about a 4 year break, so even basic stuff is taking forever to re-learn - I have a feeling that this is going to be a dumb question. Any suggestions on the best way to: SELECT count(<other table entry id>) FROM <other table> WHERE <the entries in this table referencing other table id> = <entries in other table by other table entry id> Basically, I just want to construct multiple rows of data that say: "here's the details of a Topic, and there are 10 (or whatever) Entries for this Topic" It seems like it should be simple enough. Code:
View Replies !
Create A Table Say 3 Rows 3 Cols And Put An Include In Each Table Cell
I have been playing with php includes and thought it would be interesting to create a table say 3 rows 3 cols and put an include in each table cell pointing to other sites, i thought make each cell 500px wide and i would have a page with say four news sites from different countries, so i built my table added this in <?php include("http://www.cnn.com")?> plus others uploaded it then sat back to watch my master peice in action, but hey guess what! includes dont quite work like that, the sites all loaded under each other and the page was veery wide, and even my nav table include had the same rollover effect as the first site in the includes. Is there a way this can be done easily or should i forget this idea now, I have no need for this on my site I am just at the start of learning php so have tried this just for education reasons.
View Replies !
Drop Down A Table Is Suppose To Show Up To Give You The Geocache Table
Under the drop down a table is suppose to show up to give you the geocache table when I had the drop down setup as html it worked fine which leads me to believe something is conflicting in my code. I need an extra pair of eyes to look at it, cause I just cant catch what Im missing. PHP Code: <?php //include files to configure db and open it include 'config.php' include 'opendb.php' //pull name for drop down $query  = "SELECT name FROM geocache"; $result = mysql_query($query); $options = ""; // find the selected geo name $result2 = mysql_query("SELECT * FROM geocache WHERE name = '" . $_POST['name'] . "'"); ?> ........
View Replies !
Outputting A Table Or Form Using SHOW FIELDS FROM Table
In the code the MySQL database was queried using "SHOW FIELDS FROM table" which and the returned results of column names was then use to build an output for a form and a table with php using a series of if statements along the lines of if the returned field name matches something echo a text input field. I have never seen this done this way before, so I want to get the opinion of the devshed user. Does it seem like an unsual long process to build up a form. Is there a security advantage doing it this way? Has anyone ever done it this way before?
View Replies !
Finding Matches In A Table And Then Moving That Match To Another Table?
Ok, I have a database that has a table called critiera in this table is to fields on is ID and the other is critiera. Now I want to filter out all the one that don't apple to the list and move the one that match to a different database. I know how to open a connection, close, select but I don't know how I would inside of a database use another one as the way to create the list of critieras....
View Replies !
Using PHP To Sort Data In MySQL Table 1 By Values In Table 2
I have a MySQL database with 2 tables in it. products and prices.. Products has a field in it called 'prodno'. Prices has a field in it called 'prodid'. There is one of each item in products and each product has it's own unique 'prodno' There are multiple instances of each product's pricing in prices.. One for each price.. So if a product had multiple prices depending on quantity it would have an entry for each price.. Example: id = 1 prodid = 7001 qty = 300 price = 12.5 id = 2 prodid = 7001 qty = 400 price = 15.5 I was wondering if I could query the database getting info from the products table but sort it according to the prices in the prices table. Kinda like doing a "SELECT * FROM products" ordering it by the lowest price value from each item.. This is all very confusing to me, and I'm the one writing it. Let's try one last time.. Query the database selecting * from products (I plan on using all the info in products) and ordering them by the lowest price for each item in the prices table. I've tried sorting the results of just a basic SELECT * FROM products using Javascript and PHP but with pagination in the results it makes it a bit hard.
View Replies !
Showing Data From A Table Based On Infos From Another Table!
i have 2 tables in my database : THREAD, and POST THREAD's rows are: THREADID, TITLE + FORUMID + REPLYCOUNT + VIEWS POST's rows are: THREADID, PAGETEXT and PARENTID i'm a big php newbie... I want to display the LAST TWO messages (highest THREADID) of my forum number 99 (FORUMID=99). I can probably do that, but the problem is that the text of the message is located in another table.. and it's getting too hard for my low-skilled brain lol so basically I would like to check in "THREAD" for the highest THREADID where FORUMID=99, display the TITLE, REPLYCOUNT and VIEWS, and then check in POST for the same two THREADID's where PARENTID=0 (meaning it is the first message in the thread) and finally display the PAGETEXT ! Could anyone give me a PHP code that would display that?
View Replies !
Update Table While Insert Data To Another Table
it seem like mine coding din work. [php]<? include("checkin.html"); $conn=mysql_connect('localhost','root','') or die ('Could not connect to server'); $today = date("Y.m.d"); mysql_select_db('hms', $conn); $ok = mysql_query("INSERT INTO check_in(ID,room_no,datein)values ('$ID','$room','$today')", $conn); if( $ok ){ $up = mysql_query("UPDATE studtable SET checked = 'checkin' where [ID] = '%ID'); if(mysql_affected_rows( $up ) == 1) { echo'Checked IN!' }else { echo'No such student to check in' }} else { echo'Check In FAILED, please check again'}?>[php]
View Replies !
Search Results From Table And Relational Table
I have a products table with product name, supplier, size, price etc. and a category table with assigned products. Products can belong to multiple categories so the relationship is one to many. I want to search the products by category, supplier, size and minimum & maximum price. My current sql looks like this: PHP Code: SELECT cats.*, products.*, FROM cats, products WHERE cats.catid LIKE '$_GET[catid]' AND products.price BETWEEN '$_GET[minprice]' ANDÂ Â '$_GET[maxprice]' AND products.supplier LIKE '$_GET[supplier]' AND products.size LIKE '$_GET[size]' this returns the correct results from the main products table search parameters but doesn't return the correct category. I saw some postings about UNION but I don't understand it and am not even sure if it's what I need.
View Replies !
OnLoad Update Table Depending On Y/N Value Of Another Table
I need to update a field in a table that has 2 fields: LaptopName StatusID I have another table called loans, in this table one of the fields has a complete Y/N value (depending on whether the loan is complete, i.e. returned laptop to me) i need to make it so that "Onload" the statusID field of the laptops table is updated to "AVA" (avaliable) but only if the loan tables "complete" field is set to "Y". How is this done please? I think through the Onload command but am unsure?
View Replies !
Getting Sum Of Table Cell Values From A Large Table
I have a MySQL table that contains data from a survey. The survey has about 30 questions and hence at least 30 fields in the table. All the questions are multiple choice and have 5 to 10 possible answers. Now, to generate a report that contains totals of each item (for example if a question "favorite sport" has 10 possible answers, S1, S2,...,S10, I need to know how many people answered S1 as their favorite sport, how many answered S2, and so on. And this I need to do for each field for any given date range. Code:
View Replies !
Match Whats Between <TABLE And </TABLE>
Very simple regex, but just can't get it to work: I'm trying to match whats between <TABLE and </TABLE> this is the code I'm using: if(preg_match_all("/<TABLE(.*)</TABLE>/i", $page, $matches)) { $num_matches = count($matches[0]); for($i=0; $i<$num_matches; $i++) { $this_match = $matches[1][$i]; echo $this_match . "<br> "; } } Any ideas???
View Replies !
|