#11
|
||||
|
||||
ooo I think i got it...
PHP Code:
|
#12
|
|||
|
|||
$lastbred will need to be assigned a value. this value is going to come from the DB owned_adoptables lastbred column. So I am not sure where you are putting this but one way you can do it is.
PHP Code:
I hope I am explaining this clearly If you want, what php page are you trying to add this in to, I can test it out latter when I am at work and see if I can make better sense of it. ATM I am kinda of distracted with Terraria ^.^; |
#13
|
||||
|
||||
LoL I kept posting so I think you missed mine... I think I got it =p
This: PHP Code:
This is completely unrelated to this issue... But I added in Date Caught/Bred and the ones that were already caught or bred before this was added have no dates. Is there an easy way to insert into the database a default date for those who don't have one? |
#14
|
|||
|
|||
You are welcome. :)
you can run something like UPDATE table SET Date Caught/Bred = '0' WHERE Date Caught/Bred = '' |
#15
|
||||
|
||||
do I do that in the phpadmin panel?
|
#16
|
||||
|
||||
uh oh... i did this
UPDATE `adopts_owned_adoptables` SET `date`=2011-08-10 WHERE date=0000-00-00 and it put 1993 in there LOL Shoot I keep double posting =( Sorry guys!! Got it =) It was UPDATE adopts_owned_adoptables SET date='2011-08-10' WHERE date='1993' Last edited by SilverDragonTears; 08-10-2011 at 09:11 PM. |
#17
|
|||
|
|||
that is cool that you got it working. :)
question in your DB what type is date is it a varchar or date format, and when comparing dates in php do you have to do anything special? |
#18
|
||||
|
||||
it's varchar... and not sure I understand the second question
|
#19
|
|||
|
|||
well I just wonder what would happen when you compare $date with $currentdate
like $date = '2010-08-10' $currentdate = '2011-08-11' if $date < $currentdate "your adopt is able to do something" I guess what I am confused about is how comparing strings work, because php doesnt know that tho two variables are dates, or at least I dont think it knows. I will have to look in to it. |
|
|
What's New? |
What's Hot? |
What's Popular? |