Jump to content

Printing sql results into a table


will_1990

Recommended Posts

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

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.