Forum Moderators: coopster

Message Too Old, No Replies

How do I stop sql errors?

         

themoron1

7:36 pm on May 23, 2004 (gmt 0)

10+ Year Member



I have a script that returms some data from a mysql database and displays it as javascript which is then accessed by an html page. Is there a way to get php to return some javascript rather than the error message if the database is down? I have tried if!$link but it returns my javascript and the error.

Cheers

themoron :@)

DanA

7:56 pm on May 23, 2004 (gmt 0)

10+ Year Member



you can test $anyvar=@mysql_connect(...
to generate some javascript if $anyvar is false

themoron1

9:11 am on May 24, 2004 (gmt 0)

10+ Year Member



Thanks DanA,

I didn't know about the @ thingie. Ah, you learn something new every day!

themoron :@)