RE: [PHP] Problem with MySQL

From: Date: Tue, 20 Mar 2007 16:19:39 +0000
Subject: RE: [PHP] Problem with MySQL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-250929@lists.php.net to get a copy of this message
2007. 03. 20, kedd keltezéssel 16.08-kor Ford, Mike ezt írta: > On 20 March 2007 13:26, Németh Zoltán wrote: > > > 2007. 03. 20, kedd keltezéssel 15.09-kor Pavel Kaznarskiy ezt írta: > > > Hello ! > > > I have problem with access in mysql > > > > > > it is my code: > > > <html> > > > <head><title>SQL Query Sender</title></head> > > > <body> > > > <?php > > > $host=""; > > > $user=""; > > > $password=""; > > > /* Section that executes query */ > > > if(@$_GET['form'] == "yes") > > > > what do you want with that '@' here? > > that operator can be used to suppress error messages when calling > > functions but not when using a variable > > What complete tosh! @ is a unary operator, so can be applied to any expression. > > Proof: > > <?php > echo "no @ --", $HTTP_GET_VARS['bogus'], "<br />\n"; > echo "with @ --", @$HTTP_GET_VARS['bogus'], "<br />\n"; > ?> > > Result: > > no @ -- > Warning: Undefined index: bogus in c:\www-lco\scripts_etc\lco\php\test.php on line 18 > > with @ -- > > > Also: > > <?php > $a = 123; > echo "no @ --", $a/0, "<br />\n"; > echo "with @ --", @($a/0), "<br />\n"; > ?> > > Result: > > no @ -- > Warning: Division by zero in c:\www-lco\scripts_etc\lco\php\test.php on line 19 > > with @ -- > > > Not that I'm necessarily advocating this as a technique, but let's not spread > disinformation! okay, sorry for my ignorance ;) greets Zoltán Németh > > Cheers! > > Mike > > --------------------------------------------------------------------- > Mike Ford, Electronic Information Services Adviser, > Learning Support Services, Learning & Information Services, > JG125, James Graham Building, Leeds Metropolitan University, > Headingley Campus, LEEDS, LS6 3QS, United Kingdom > Email: m.ford@leedsmet.ac.uk > Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 > > > To view the terms under which this email is distributed, please go to > http://disclaimer.leedsmet.ac.uk/email.htm

« previous php.general (#250929) next »