$result=mysql_query("select employer.employer_id,employer.companyname,post_job.jobtitle,post_job.owner,post_job.tdate,post_job.id from post_job,employer ORDER BY tdate.post_job ASC LIMIT 0,10
") or die("ERROR:".mysql_error());


it is not working..........

Recommended Answers

All 12 Replies

What is the error ?

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$result=mysql_query("select employer.employer_id,employer.companyname,post_job.' at line 1

sorry.it id not not displaying tdate properly.it is displaying as 0000-00-00.but in the dbase it is not like tat

huh! Check if the query works in phpmyadmin/mysql. Nothing wrong with the query though.

hmm.. So there aren't any errors ?

based on the id in post_job table i want to fetch name of the company from employer is my query right

in my sql i am getting this output.

Can you post your code ? If you are getting the output in mysql and not in php, there must be something missing in php.

ya i can.i am not able to get the output in mysql.i have a field called tdate.it contains dates.when i executed the above query in mysql it is fetching all the fields as per as the query but all the values in tdate is getting displayed as 0000-00-00.but in the table date values are there....

Add a condition, where tdate !="0000-00-00" in your query. That will return only valid dates.

thanks..it is working

You are welcome :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.