javascript - mysql Date is returning strange characters -
so have large query working fine until added jobs.deliverydate. query still has no errors when echo out value echoes these strange characters. i'm wondering if has mysql datatype. variable has datatype of date, i'm able pull in datatype of datetime fine.
$query = $connect->prepare(" (select jobs.jobid, jobs.jobname, jobs.pdf, jobs.deliverydate, jobstatus.status, rooms.roomid, rooms.roomname, rooms.assemblys, rooms.assemblyf, rooms.assembledf, rooms.assemblyneeded, rooms.woodtype, rooms.finishtype, rooms.finishcolor, rooms.numberofboxes, rooms.isrush, rooms.description, jobnotes.note jobs left join rooms on jobs.jobid = rooms.jobid left join jobnotes on jobnotes.jobid = jobs.jobid left join jobstatus on jobstatus.statusorder = jobs.statusorder (rooms.assemblyneeded = 1) , ((rooms.isrush = 1 , rooms.assemblyf = 0) or (rooms.isrush = 1 , rooms.assemblyf null)) group rooms.roomid) union (select jobs.jobid, jobs.jobname, jobs.pdf, jobs.deliverydate, jobstatus.status, rooms.roomid, rooms.roomname, rooms.assemblys, rooms.assemblyf, rooms.assembledf, rooms.assemblyneeded, rooms.woodtype, rooms.finishtype, rooms.finishcolor, rooms.numberofboxes, rooms.isrush, rooms.description, jobnotes.note jobs left join rooms on jobs.jobid = rooms.jobid left join jobnotes on jobnotes.jobid = jobs.jobid left join jobstatus on jobstatus.statusorder = jobs.statusorder ((rooms.assemblyneeded = 1 , jobstatus.statusorder >= 0 , rooms.assemblyf null) or (rooms.assemblyneeded = 1 , jobstatus.statusorder >= 0 , rooms.assemblyf = 0)) , ((rooms.isrush = 0 , rooms.assemblyf = 0) or (rooms.isrush = 0 , rooms.assemblyf null)) group jobs.jobname, rooms.finishcolor order jobs.statusorder = 7 desc, deliverydate, jobname, finishtype limit 50)"); if(!$query) { echo("query failed because " . mysqli_error($connect)); }; $query->execute(); $result = $query->get_result(); while($row = mysqli_fetch_assoc($result)) { $deliverydate = $row['deliverydate']; echo $deliverydate; }
this may not proper way solve problem able date using
extract(year jobs.deliverydate) deliverydateyear, extract(month jobs.deliverydate) deliverydatemonth, extract(day jobs.deliverydate) deliverydateday,
wiki
Comments
Post a Comment