473,378 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

delete statement not working

tolkienarda
316 100+
hi all
i have a loop that decides if a row should be deleted. i know i am getting into my if statement and that the variable that stores the id is correct but the delete statement wont work can someone look and see what dumb mistake i made

[PHP]
$a=mysql_query("DELETE FROM 'calendar' WHERE 'id'='$row2[0]'");
[/PHP]

i know that $row2[0] = the id cause i have an echo statement under that but for some reason my stuff never gets deleted from the database

eric
Mar 14 '07 #1
3 1259
tolkienarda
316 100+
hi all
i have a loop that decides if a row should be deleted. i know i am getting into my if statement and that the variable that stores the id is correct but the delete statement wont work can someone look and see what dumb mistake i made

[PHP]
$a=mysql_query("DELETE FROM 'calendar' WHERE 'id'='$row2[0]'");
[/PHP]

i know that $row2[0] = the id cause i have an echo statement under that but for some reason my stuff never gets deleted from the database

eric

my bad i needed to take the quotes out around calendar
Mar 14 '07 #2
Atli
5,058 Expert 4TB
You don't need the quotes around the id column either.
Mar 14 '07 #3
tolkienarda
316 100+
ok thanks

eric
Mar 14 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: de Beers | last post by:
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. ...
14
by: php newbie | last post by:
I am getting error messages when I try to delete from a table using the values in the table itself. The intent is to delete all rows from TableA where col_2 matches any of the col_1 values. ...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
16
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the...
14
by: Darin | last post by:
I have a table that I want to delete specific records from based on data in other tables. I'm more familiar with Access '97, but am now using 2003, but the database is in 2000 format. In '97, I...
2
by: Ralf | last post by:
I have an oracle data adapter built. I did it thru vb.net controls. The query used access' multiple tables, so the delete and update commands will not get built. This has not been a problem in...
6
by: ilo | last post by:
When I want to delete a data from a table that this tabl has a trigger and this trigger reached another tables to delete the data in cursor I have this messeage: DELETE failed because the...
0
by: Roald | last post by:
I am working on an application that needs to implement logical deletes instead of removing the records permanently. The logical delete works by setting 3 fields (deleted flag, date and user). I...
0
by: justjazz | last post by:
I am successfully able to perform a direct sql/400 (in iseries) call to the delete statement DELETE FROM RDSUFAQA.SAPXFER but when I make a call to the same sql statement via a stored...
0
by: wolfsbane | last post by:
Alright, here it is I am trying to write a win32 app in VB 2005 to clean up user's profiles. everything works correctly except for the Delete("directory", True) statement. I get a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.