thesnarkie Posted March 23, 2010 Report Share Posted March 23, 2010 (edited) <? $mysqli = new mysqli("localhost", "", "", ""); $mysqli->query("SET NAMES utf8"); $mysqli->query("SET CHARACTER SET utf8"); $result = $mysqli->query("SELECT COUNT(a.id) AS idCount FROM account AS a WHERE a.username='freezer'"); $row = $result->fetch_array(MYSQLI_ASSOC); $mysqli->close(); ?> Vārdu sakot, pēc baigo query izsaukšanas pašās koda beigās izsaucot close() daudz kas mainīsies? Nu servera resursi.. Un,kas notiek ja viņu neizsauc koda beigās? Edited March 23, 2010 by thesnarkie Quote Link to comment Share on other sites More sharing options...
thesnarkie Posted March 23, 2010 Author Report Share Posted March 23, 2010 (edited) index.php <? $mysqli = new mysqli($host, $username, $password, $database); $mysqli->query("SET NAMES utf8"); $mysqli->query("SET CHARACTER SET utf8"); $result = $mysqli->query("SELECT COUNT(a.id) AS idCount FROM account AS a WHERE a.username='freezer'"); $row = $result->fetch_array(); include("super.php"); $mysqli->close(); ?> super.php <? $host = "localhost"; $username = "blala"; $password = "blala"; $database = "blala"; ?> Tas ir ok no drošības viedokļa, ka inklūdoju failu ar mysql detailiem? Tur neko nekā nevar izvilkt? Edited March 23, 2010 by thesnarkie Quote Link to comment Share on other sites More sharing options...
2easy Posted March 23, 2010 Report Share Posted March 23, 2010 to laikam sauc par securityfobiju Quote Link to comment Share on other sites More sharing options...
Kemito Posted March 24, 2010 Report Share Posted March 24, 2010 to laikam sauc par securityfobiju Fobija no drošības? hmm.. jauns paveids laikam būs izveidojies fobijai! :D Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 24, 2010 Report Share Posted March 24, 2010 close() var likt var arii nelikt ... Jo konekcija tiks prtraukta sha vai ta Nee ja serveris ir normali nokonfigurets tad no taa include faila neko nevares izvilkt Quote Link to comment Share on other sites More sharing options...
thesnarkie Posted March 24, 2010 Author Report Share Posted March 24, 2010 Ok, paldies. Nū, mūsdienās drošība ir svarīga. :DD Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.