fj1200 Posted February 19, 2009 Share Posted February 19, 2009 Odd thing happening here. I have a couple of production reports that have got problems with a MySQL query. I run the qry in Query browser - great, all data shows. I run it on a report on a PHP page and I get the first row missing. It started when I began to use <div>'s and css a few months ago but haven't had the time to revisit it, but I've been asked to do some more reports based on it - they like the look and feel of them - so I need to fix it. Anyone else seen this? I'm doing the queries EXACTLY as I would in a table, just substituting the table for div's. I could rebuild it with a static page but I like how it looks and want to crack this issue. Is it a css issue? I have lots of static reports pages but really want to move to a more dynamic system. I've started using PEAR as well although not here. It's not a browser thing - same in IE, FF, Chrom etc. Link to comment https://forums.phpfreaks.com/topic/145963-solved-mysql-query-displaying-1-row-less-in-php-page/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 19, 2009 Share Posted February 19, 2009 You would need to post your code to be sure, but I will guess you have a mysql_fetch_xxxxxx() statement right after your mysql_query() statement that is fetching the first row from the result set but you don't use it, then you have a while() loop that contains a mysql_fetch_xxxxxx() statement to retrieve the rest of the rows. If so, why do you have that loan initial mysql_fetch_xxxxxx() statement, that is not doing anything except to discard the first row, in your code??? Link to comment https://forums.phpfreaks.com/topic/145963-solved-mysql-query-displaying-1-row-less-in-php-page/#findComment-766618 Share on other sites More sharing options...
fj1200 Posted February 20, 2009 Author Share Posted February 20, 2009 Yup - that's got it. I was using a &GET[] to populate the report title row but only using one element of it then using a query to retrieve the rest - I now see the error of my ways (hangs head in shame) and use the $GET[] to provide the report title and header info (job id, name, date etc) and a MySQL query to get the detail. Many thanks - I was staring at it for a couple of hours yesterday. What a dipstick! Link to comment https://forums.phpfreaks.com/topic/145963-solved-mysql-query-displaying-1-row-less-in-php-page/#findComment-766892 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.