Print version of form results of MySQL database


#1

I have created a form which “GETS” information from a MySQL database when the user submits the form.

The results are displayed on a “result.php” page, in which I have provided a link to another page which is simpler in design so that it can be printed (“printable.php”)

Example of the code at the “result.php” link is:

Print this page

However, when I click on the link, the print page shows many errors and the database results are not seen on the “printable.php” page.

Eg. of error:
“Warning: Invalid argument supplied for foreach() in /home/…/script.php on line 18”

What is wrong? Has it anything to do with my links? When I link the , I don’t get the errors and the results can be seen.

How can I make the “result.php” into a printable version? My result.php consists of many tables, but I want the printable version to be just words

Would appreciate help from anyone…


#2

As soon as you link to the “printable” version, all your variables lose their values because you are not passing them on in a querystring. You can get around this using session variables, but a more elegant solution would be to use CSS to create a print version of the existing page (the page will print differently from how it looks on the screen).

si-blog
Max discount on any plan with promocode SCJESSEYTOTAL