Hi..
I am new to PHP Mysql and i am facing following problem..
..............................
Database

1 G
1 G
1 G


...........................

I want to print records like this

...........................


1---g
g
g

..............................
As we do in in crystal reports ( suppress if duplicated )

ALSO
PLEASE SUGGEST ME WHICH REPORTING TOOL IS USED IN PLACE OF
CRYSTAL REPORT FOR PHP MYSQL BASED WEB APPLICATION..
.
SO THAT WHEN THE WEBSITE IS HOSTED ON WEB SERVER
THEN THAT REPORTING TOOL IS PRESENT ON WEBSERVER
.

CRYSTAL REPORTS HAS LOTS OF FUNCTIONALITY BUT I DON'T
KNOW WHEATHER IT IS USED IN PHP/MYSQL APPLICATION OR NOT

....

PLEASE REPLY FAST

Please Help me out of it....

............................Thanks in advance

Try the following:

<?php 
$r=mysql_query('SELECT * FROM `table` ORDER BY `num` ASC') or die(mysql_error());
$prev='';
while ($row=mysql_fetch_assoc($r)) {
if ($row['num']!=$prev) {
    echo $row['num'].' ';
    }
echo 'G<br />';
$prev=$row['num'];
}
?>

Don't forget the replace 'num' with the column name.

Thanks a lot..
...

Can u suggest me the reporting tool for PHP MySql...

which is used in advance programming level of PHP/MySql....

Do you mean phpmyadmin?

As we use crystal reports in Visual Studio 2008
Simillar to that one..
Bcz crystal report has lots of good functionallity
like SUPPRESS IF DUPLICATED, VARIOUS FORMULA AND PARAMETERS ETC...

..............
As i want to fetch record from MYsql using PHP
by passing parameter and the related records are shown in a report.
which can be exported into PDF format..etc...

So did you want php to place the contents into a pdf or did you want crystal reports in Visual Studio to create the pdf? PHP has a pdf library which can be found at http://au2.php.net/manual/en/book.pdf.php For examples on the pdf module embedded into google I would suggest a simple google search.

I have just given the example of Visual Studio 2008
............
I want that user will be asked to find records having SRNO between 1 and 2
then record is printed in format like below..
.............
1-A
B
C
D
2-A
B
C
D

............

Here 1 and 2 are passed as parameters...
................

May be my Post is little bit confusing..
i apologize for that...
I just want to know..that is there any reporting tool used
in PHP mysql...
which is helpfull like Crystal reports 11..
For easily generating reports...

<?php 
$r=mysql_query('SELECT * FROM `table` ORDER BY `num` ASC') or die(mysql_error());
$prev='';
while ($row=mysql_fetch_assoc($r)) {
if ($row['num']!=$prev) {
    $i=0;
    echo $row['num'].'-A<br />';
    } else {
    $i++;
    echo strtoupper(dechex($i+10)).'<br />';
    }
$prev=$row['num'];
}
?>

Can i Encrypt my PHP code before deploying it
to server
so
if in future my client hires an another web developer
then
he will not be able to use my source code...

When it comes to encoding php code there are two options. You can use a free php script such as pobs and it will jumble up the code in a way that will make it impossible to read then anybody trying to edit it will be facing a nightmare. There are commercial alternatives such as ioncube where it is harder to crack because you have to buy it to gain access to the encoder. However in my opinion the free pobs is just as good.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.