will_1990 Posted February 27, 2009 Share Posted February 27, 2009 Hello! Which is the best way to print this queries result into a table? I know that the query is executing i just dont know how i should go about putting the results into a table. any advice on how to do this would be great, im not sure ive structured my query properly, i cheated used phpmyadmin "create php" option...but it does seem to return results. here is the code so far, it may help: $sql = 'SELECT BorName AS "Borrowers who have returned books late"' . ' FROM BookTitle, Loan, BookCopy, Borrower' . ' WHERE BookTitle.Btid = BookCopy.Btid' . ' AND BookCopy.Bcid = Loan.Bcid' . ' AND Loan.Borid = Borrower.Borid' . ' AND DateBack is NULL ' . ' AND Loan.DateDue <= CURDATE() ' . ' Group by BorName' . ' ORDER BY BorName LIMIT 0, 30 '; $result = mysql_query($sql) or die(mysql_error()); echo mysql_num_rows($result); many thanks in advance! Will Link to comment https://forums.phpfreaks.com/topic/147143-printing-sql-results-into-a-table/ Share on other sites More sharing options...
Mchl Posted February 27, 2009 Share Posted February 27, 2009 Did you take a look at examples at mysql_query manual entry? Link to comment https://forums.phpfreaks.com/topic/147143-printing-sql-results-into-a-table/#findComment-772454 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.