Jump to content

php mySQL and DISTINCT


monkeytooth

Recommended Posts

$stage2check_query   = "SELECT DISTINCT ISBN13, ISBN10, Title, Author COUNT(*) AS stage2check_rows FROM book WHERE $qStringType LIKE '%$qString%'";

 

I am trying to put together a query that will give me a distinct count of the database, there is something like 16,000,000 records in the DB, most doubles tripples etc.. of them there is maybe 200,000 unique roughly so I am trying to count that. The above line kicks back a error about not using proper syntax or something to the effect there of, specific to that line. Where did I mess this up? anyone?

Link to comment
https://forums.phpfreaks.com/topic/187302-php-mysql-and-distinct/
Share on other sites

Alright that fixed the count issue, now Im trying to do similar in the form of displaying results, but I can't get it to pull up everything in any given row.. I can only get it to pull one column of data from any given row. I need to pull all the data from the rows its finding as distinct, I tried

$display_query = "SELECT DISTINCT(*) $qStringType FROM book WHERE $qStringType LIKE '%$qString%' LIMIT 40";

 

Which doesnt work, and I have tried various varations of it still no sucsess, is it possible to actually pull a full row and not just a column there of?

 

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.