|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
Hi there,
I am trying to pull out the birthday dates from a table (MS SQL SERVER) so that the table that is displayed on the website only displays a list of birthdays. My table contains the DOB column in datetime format. I have used the following query in SQL Server Enterprise Manager: SELECT CONVERT(varchar(10),DOB,103) FROM table1 and it works fine. It returns the date the way I want it - in SQL Server Enterprise Manager. However, when I try to display it on the website, I am getting ZERO results. Nothing is displayed. This is my code on the PHP site: $query = "SELECT CONVERT(varchar(10),DOB,103) FROM table1"; $result=@mssql_query ($query); while ($Row=@mssql_fetch_array($result)) { echo("<tr><td><b>$Row[DOB]</b></td></tr>\n"); } How would I get the results from the query displayed in my table? Or do I retrieve all DOBs first and then convert them once they are retrieved? No clue.... Thanks for your help, N |
|
#2
|
||||
|
||||
|
your query is fine
your problem seems to be php you stand a better chance of getting an answer in the php forum |
|
#3
|
||||
|
||||
|
cheers. will try that. thought it was a SQL thingy.
N ![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > CONVERT Date? How to display results? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|