note 48049 added to function.mysql-connect

From: Date: Thu, 09 Dec 2004 21:48:38 +0000
Subject: note 48049 added to function.mysql-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-81615@lists.php.net to get a copy of this message
This function executes a SQL sentence. define("_HOST","localhost"); //Host BD... define("_BD","admin"); //BD... define("_USR",""); //User... define("_PSR",""); //Password... .... .... function BDConexion($sSQL) { mysql_connect(_HOST, _USR, _PSR); $result = mysql_db_query(_BD, $sSQL); return @$result; mysql_free_result($result); } Examples: //Insert BDConexion("INSERT INTO ... VALUES ...."); //Updates BDConexion("UPDATE SET ... WHERE ...."); //Queries $result = BDConexion("SELECT * FROM ... WHERE ..."); while (mysql_fetch_array($result) = $r) { echo $r["data"]; } More: http://tryke.blogcindario.com ---- Manual Page -- http://www.php.net/manual/en/function.mysql-connect.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+48049 Delete -- http://master.php.net/manage/user-notes.php?action=delete+48049&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48049&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48049&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48049&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48049&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48049&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+48049&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81615) next »