|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#16
|
|||
|
|||
|
RE: more issues
Just a guess here, but remember that PHP's 'date' function is looking for a UNIX timestamp, not the date values that is typically returned from a MySQL query. So, if your DB date is "20020610162214", you need to covert that to UNIX timestamp -- easiest to do that in the SELECT statement: "select unix_timestamp(date) as date, email, name, news ...".
|
|
#17
|
|||||
|
|||||
|
RE: more issues
Simply format it when you pull it from the database, i would usually do something like :
php Code:
strtotime works like a charm, and date() needs the number of seconds since whenever long ago.. Hope this helps |
|
#18
|
|||
|
|||
|
RE: more issues
thanks for all your help guys, I tried them out, and None of them seems to be working, so Now I'm thinking if there is a way of doing it like in matts newsscript, by sending it when the news is submitted, maybe not into a timestamp row but maybe just a text row?
|
|
#19
|
|||
|
|||
|
RE: more issues
hm.. i'm lost.
|
|
#20
|
|||
|
|||
|
RE: more issues
Oh geez, you using TIMESTAMP type.... use datetime type and manually insert the time using now()
ie. insert query : "INSERT INTO news (dateadded) VALUES (now())" kindof thing, then the strtotime will work.. either that or manually dissect and format the timestamp first.. |
|
#21
|
|||||
|
|||||
|
RE: more issues
okay now I get this error
Warning: Wrong parameter count for mysql_fetch_assoc() in /home/gmflp/public_html/news.php on line 80 here is my code php Code:
Also I have no clue about the insert into news bit, but we can get to that bit later, cheers for your help |
|
#22
|
|||
|
|||
|
RE: more issues
should be |
|
#23
|
|||
|
|||
|
RE: more issues
I'm still getting the same error :/
|
|
#24
|
|||
|
|||
|
RE: more issues
Sorry, bout that.. yeah, it's supposed to be mysql_fetch_assoc($result).. try printing $result, if you don't get something like "Resource id #xx" then print(mysql_error()) and see what that gives you..
|
|
#25
|
|||
|
|||
|
RE: more issues
okay, Now I think I done this right 'cause now I'm getting error
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/gmflp/public_html/news.php on line 79 - posted by |
|
#26
|
|||
|
|||
|
RE: more issues
That's an invalid query, try this:
$qry = "SELECT * FROM news ORDER BY id LIMIT 5"; |
|
#27
|
|||
|
|||
|
RE: more issues
Sorry, i wasn't concentrating on the SQL statement, coz i thought u were gonna replace it.. ;)
|
|
#28
|
|||
|
|||
|
RE: more issues
okay, good news, the date is showing, WEHEY, thanks guiys, bad news, it looks abit "funny", http://gmflp.l33t.ca/news.php this will show you what I mean here is my code at the mo php Code:
|