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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-05-2003, 02:27 PM   #1
galleryseek
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
galleryseek is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2003, 02:49 PM   #2
Lane
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'
__________________
Lane is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2003, 04:13 PM   #3
StuartD
Sofa King Band
 
StuartD's Avatar
 
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.
StuartD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2003, 11:19 PM   #4
galleryseek
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.
galleryseek is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2003, 11:27 PM   #5
KobyBoy
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.
KobyBoy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2003, 11:29 PM   #6
galleryseek
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 8,234
Quote:
Originally posted by KobyBoy
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.
thanks, figured it out from that.. there was a damn space in each date entry at the beginning.
galleryseek is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2003, 11:30 PM   #7
gornyhuy
Chafed.
 
gornyhuy's Avatar
 
Join Date: May 2002
Location: Face Down in Pussy
Posts: 18,041
Quote:
Originally posted by galleryseek

thanks, figured it out from that.. there was a damn space in each date entry at the beginning.
Happens to my clients all the time, in mysql and also in excel...
__________________

icq:159548293
gornyhuy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2003, 11:39 PM   #8
KobyBoy
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.
KobyBoy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.