Jump to content


Mysql:@mysql_connect


2 replies to this topic

#1 sanitarium

    Young Padawan

  • Members
  • Pip
  • 11 posts

Posted 28 February 2008 - 05:41 PM

hi everybody

what's the diiference between @mysql_connect and mysql_connect?
thank you

5 views and any help!!!

Edited by Mr. Matt, 28 February 2008 - 06:18 PM.


#2 tones

    Young Padawan

  • Members
  • Pip
  • 10 posts

Posted 28 February 2008 - 06:04 PM

Placing the @ infront of it will stop the default error message showing the file route details. And allow you to display your own custom message.

example

$error = "<html><head><title>Error</title>
			   <style>P,BODY{ font-family:arial,sans-serif; font-size:11px; }</style></head><body>
			   &nbsp;<br><br><blockquote><b>There appears to be an error with the database.</b><br>

			   You can try to refresh the page by clicking <a href=\"java script:window.location=window.location;\">here</a>.<br></body></html>"; 

@mysql_connect(HOST, USER, PASS) or die($error);
@mysql_select_db(DATA) or die($error);

So if there is no connection, rather than tell the public what the error is, on what line of which ever file it will display "There appears to be an error with the database. You can try to refresh the page by clicking here"

Editors note - Ref: http://php.net/operators.errorcontrol ~rc

Edited by rc69, 28 February 2008 - 11:47 PM.


#3 sanitarium

    Young Padawan

  • Members
  • Pip
  • 11 posts

Posted 28 February 2008 - 06:15 PM

thanks a lot tones ;)

Edited by sanitarium, 28 February 2008 - 06:16 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users