![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 8,234
|
a lil mysql help? (using phpMyAdmin)
i'm trying to delete all the rows with "December 4, 2003" in the Date field... but when i run the below code, it just refreshes to the page, but doesn't delete anything:
DELETE FROM `crtgpcache` WHERE Date='December 4, 2003' what should i change it to so it'll delete all the damn rows? thx |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Will code for food...
Join Date: Apr 2001
Location: Buckeye, AZ
Posts: 8,496
|
what type is the field, date or datetime?
and try using '2003-12-04'
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
If your code is done properly really, it should be done in mktime() dates.
Inwhich case... the dates in the database might look like this "1070524800" So your query should look like "WHERE Date = '1070524800' otherwise, as Lane said, it could be a date field which would be done as "2003-12-4" or something like that. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 8,234
|
its a VarChar field... and i KNOW the data within hundreds of these fields, the Date field = "December 4, 2003".. i want them deleted! and my query in my initial post is not working.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Jul 2003
Location: Purgatory
Posts: 201
|
Do a SELECT COUNT(*) FROM crtgpcache WHERE Date = "December 4, 2003" This should return the number of rows that satsify your query. If nothing gets returned then you know there is nothing wrong with your DELETE query but rather there are no rows in the database that satisfy your condition.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 8,234
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Chafed.
Join Date: May 2002
Location: Face Down in Pussy
Posts: 18,041
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Jul 2003
Location: Purgatory
Posts: 201
|
Yeah, whitespaces could mess things up. Whenever I put something into the database and I know it's not supposed to have a space in the beginning or at the end (like dates, IP addresses, etc...) I use PHP's trim() function (http://www.php.net/manual/en/function.trim.php) to remove whitespace(s) from the beginning and the end of the string. This saves my butt all the time.
|
![]() |
![]() ![]() ![]() ![]() ![]() |