RE: display text in screen

From: Date: Fri, 11 Jan 2002 17:59:47 +0000
Subject: RE: display text in screen
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-15667@lists.php.net to get a copy of this message
Just add echo statments at whatever steps you want to display comment or detail for; something like: <html> <head><title>Some page</title></head> <body> <? echo "Connecting to database: "; $dbconnection = @mysql_connect("localhost","username","password"); if($dbconnection !== false){ echo "OK"; }else{ echo "FAILED<br>"; echo mysql_error(); echo "</body></html>"; exit; } echo "<br>Selecting database 'foo': "; if(@mysql_select_db("foo", $dbconnection)){ echo "OK"; }else{ echo "FAILED<br>"; echo mysql_error($dbconnection); echo "</body></html>"; exit; } //Et cetera... ?> </body> </html> If you're doing this within an HTML table it could get tricky because you would need to close the table structure after an error, but otherwise it's pretty straightforward. It can be really helpful for debugging and making sure a script is working correctly! -Andy > -----Original Message----- > From: Sommai Fongnamthip [mailto:sommai@thaithanakit.co.th] > Subject: display text in screen > > Hi, > I have easy problem to ask someone. I wrote PHP to update > data with many > step and need to display comment or detail in each step. But I got all > comment or detail display after it finished update all step. How could I > display each step comment immediately??

« previous php.db (#15667) next »