Jump to content

Is this code correct


deansaddigh

Recommended Posts

I am trying to get the oldest arrival_date from my db and i have this code

 

/*Build sql query*/ 
                            $yearsql = mysql_query("SELECT * FROM bookings order by arrival_date desc");

						/*Get the last arrival_date e.g the oldest*/
					  	echo $yearresult = mysql_result($yearsql ,arrival_date);

 

But it returns the number 852

 

Does anyone know why this is?

 

Also the arrival_date field in the db isnt a date type, some one put it in as a string so the date looks like this

20092019 

etc

Link to comment
https://forums.phpfreaks.com/topic/187690-is-this-code-correct/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.