magcr23 Posted June 17, 2015 Share Posted June 17, 2015 Hi, i need to create a page where it show's all the new registrations. I thought in create a page where it show's all registrations. But that's not working so well... <?php @$today = getdate(); print_r($today); ?> <?php $con=mysqli_connect("localhost","root","6794","website"); if (mysqli_connect_errno()){ echo "Failed to connect to MySQL: " . mysqli_connect_error(); } ?> <div class="row"> <form action="novos.php" method="post" > <?php $mostra= "SELECT COUNT(*) FROM `artesoes` WHERE data = $today"; $query = mysqli_query($con, $mostra); while($ln = mysqli_fetch_assoc($query)){ echo @$ln[nome]; echo '<a href="ativar.php?teste='.$ln['id'].'"></a>'; echo '<br /><hr />'; } ?> </form> </div> ?php mysqli_close($con); ?> Someone can tell me what am i doing wrong? Or if there's a better way to do it? Link to comment https://forums.phpfreaks.com/topic/296878-show-registers-by-day/ Share on other sites More sharing options...
Muddy_Funster Posted June 17, 2015 Share Posted June 17, 2015 some idea of what you mean by "not working so well" would be more than a little helpful. Also, a Describe of your table would be a big help as well. Link to comment https://forums.phpfreaks.com/topic/296878-show-registers-by-day/#findComment-1514172 Share on other sites More sharing options...
Barand Posted June 17, 2015 Share Posted June 17, 2015 Surely you noticed that getdate() was returning an array and not a date? Use SELECT COUNT(*) FROM `artesoes` WHERE data = CURDATE() Link to comment https://forums.phpfreaks.com/topic/296878-show-registers-by-day/#findComment-1514177 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.