½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
happycgi
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > PHP > PHP ¼Ò½ºÃ¢°í > À¥ À¯Æ¿¸®Æ¼ > Mysql Ŭ·¡½º ¿Ü ±âŸ Ŭ·¡½º »ó¼¼Á¤º¸
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
ASP
css
html
mysql
jquery
image
API
Mobile
¸Þ´º
slide
°Ô½ÃÆÇ
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
Mysql Ŭ·¡½º ¿Ü ±âŸ Ŭ·¡½º
¼Ò½ºÅë°èÁ¤º¸ ¿À·ù½Å°í ¹× ¹®ÀÇ
ÇØÇÇÆÀ
³×ƼÁð
Æ®À§ÅÍ·Î º¸³»±â ÆäÀ̽ººÏÀ¸·Î º¸³»±â
¼Ò½ººÐ·ù À¥ À¯Æ¿¸®Æ¼
´Ù¿î·Îµå Ƚ¼ö 742 ȸ
°£´Ü¼³¸í Mysql ¹× ±âŸ À¥ÇÁ·Î±×·¡¹Ö ÇÒ ¶§ ÇÊ¿äÇÑ ±â´ÉµéÀ» ¸ðÀº Ŭ·¡½ºÀÔ´Ï´Ù. Ãʺ¸ºÐµé¿¡°Ô ¸¹Àº µµ¿òÀÌ µÇ±æ ¹Ù¶õ´Ù´Â °³¹ßÀÚ´ÔÀÇ Á¤¼ºÀÌ µé¾îÀֳ׿ä ^^
Æò°¡Çϱâ ÈǸ¢ÇÔ ¸Å¿ìÁÁÀ½ ÁÁÀ½ ±¦ÂúÀ½ º¸Åë º°·Î
¼Ò½º´Ù¿î·Îµå µ¥¸ð ¹Ì¸®º¸±â°¡ ¾ø½À´Ï´Ù ½ºÅ©·¦Çϱâ
++++++++++°³¹ßÀÚ´ÔÀÇ ¼³¸íÀÔ´Ï´Ù.++++++++++++


À§ÀÇ ÀÚ·á¿¡´Â Ŭ·¡½ºµéÀÇ ¼Ò½º¿Í Ŭ·¡½º¿¡ ´ëÇÑ ·¹ÆÛ·±½º°¡ ÀÖ½À´Ï´Ù
¿¬¶ôÀº
paranwave@korea.com
paranwave@hanmail.net
paranwave@metarica.com
À¸·Î ÇØÁֽñ¸¿ä
Á¦ ȨÆäÀÌÁö¿¡ ¿Í¼­ Áú¹®ÇØÁּŵµ µË´Ï´Ù.
http://teambus.pe.kg

# Ãß°¡ ¾÷µ¥ÀÌÆ® »çÇ× #
# bool IsValidResult(void);
# ÀÎ ÀÚ : ¾ø À½
# ¹Ýȯ°ª : Äõ¸®ÀÇ °á°ú°¡ À¯È¿Çϸé true ¸¦ ¾Æ´Ï¸é false ¸¦ ¸®ÅÏÇÕ´Ï´Ù.
# ¼³ ¸í : select Äõ¸®¸¦ Á¦¿ÜÇÏ°í insert,update,delete ´Â Äõ¸®ÀÇ °á°ú¸¦ ºÎ¿ï °ªÀ¸·Î
# ¸®ÅÏÇÕ´Ï´Ù. ÀÌ·²°æ¿ì $mySQL->Next() °°Àº ÇÔ¼ö¸¦ ¾²¸é °á°ú°¡ ¾ø±â ¶§¹®¿¡
# ¿À·ù°¡ »ý±â°ÚÁÒ. ±×°ÍÀ» ¹æÁöÇϱâ À§Çؼ­ ¸¸µé¾ú½À´Ï´Ù.

# NO_HAVE_RESULT ¿¹¿Ü Ãß°¡
# »ç¿ëÀÚ°¡ ´ÙÀ½°ú °°Àº Äõ¸®¸¦ Çß´Ù°í »ý°¢ÇØ º¾½Ã´Ù.
# $mySQL->Query("select * from testmemo");
# »ç¿ëÀÚ´Â µ¥ÀÌŸÀÌ ÀÖ´Â ÁÙ ¾Ë°í
# $mySQL->First();
# while(!$mySQL->IsEOF())
# {
# $mySQL->Field("title");
# $mySQL->Next();
# }
# ÀÌ·± Äڵ带 ½èÀ» °æ¿ì ´ç¿¬È÷ °á°ú°¡ ¾ø±â ¶§¹®¿¡ ¿¡·¯°¡ ¹ß»ýÇÕ´Ï´Ù.
# ÀÌ ¶§ »ç¿ëÀÚ°¡ À§ÀÇ Äڵ带 ¾²±âÀü¿¡ °á°ú°¡ À¯È¿ÇÑÁö¸¦ »ìÆ캸°í ÇÏ´Â °ÍÀÌ
# ÁÁ°ÚÁÒ. ¸¸¾à¿¡ »ç¿ëÀÚ°¡ °á°úÀÇ À¯È¿ÇÔÀ» üũÇÏ´Â ·çƾÀ» »©¸Ô¾úÀ» ¶§¸¦
# ´ëºñÇÑ ¿¹¿Ü ÄÚµåÀÔ´Ï´Ù.
# À§¿¡¼­ ¾Æ¹«·¯ µ¥ÀÌŸ°¡ ¾øÀ» °æ¿ì
# [¿¹¿Ü¹ß»ý] NO_HAVE_RESULT Äõ¸®¿¡ ´ëÇÑ °á°ú°¡ ¾ø½À´Ï´Ù.
# ¶ó´Â ¿¹¿Ü°¡ ¹ß»ýµË´Ï´Ù.

# À¯È¿¼ºÀ» üũÇϱâ À§Çؼ­
# if($mySQL->IsValidResult())
# {
# $mySQL->First();
# while(!$mySQL->IsEOF())
# {
# $mySQL->Field("title");
# $mySQL->Next();
# }
# }

# ¹× ±âŸ ¹ö±×µéÀ» ¼öÁ¤ÇÏ¿´½À´Ï´Ù.
# ÀúÀÇ ÀڷḦ »ç¶ûÇØ Áּż­ °í¸¿½À´Ï´Ù^^

°¢ Ŭ·¡½º ¿¹ÀÔ´Ï´Ù
[CMysql]
$mySQL = new CMysql;
$mySQL->Connect("localhost","meme","1234","memedb");
$mySQL->Query("select * from pboard");
$mySQL->Last();
while(!$mySQL->IsBOF())
{
echo $mySQL->Field("name")."-";
echo $mySQL->Field("title")."-";
$mySQL->Prev();
echo "
";
}
echo "
";
$mySQL->First();
while(!$mySQL->IsEOF())
{
echo $mySQL->Field("name")."-";
echo $mySQL->Field("title")."-";
echo $mySQL->Field("idx")."-";
$mySQL->Next();
echo "
";
}

//DB CHANGE
$mySQL->Query("select * from group_board");
$mySQL->Last();
while(!$mySQL->IsBOF())
{
echo $mySQL->Field("name")."-";
echo $mySQL->Field("title")."-";
$mySQL->Prev();
echo "
";
}
echo "
";
$mySQL->First();
while(!$mySQL->IsEOF())
{
echo $mySQL->Field("name")."-";
echo $mySQL->Field("title")."-";
echo $mySQL->Field("bgcolor")."-";
$mySQL->Next();
echo "
";
}

//Fileld Info
$mySQL->fFirst();
while(!$mySQL->fIsEOF())
{
$objField = $mySQL->FieldInfo();
echo $objField->name;
echo "
";
$mySQL->fNext();
}
echo "
";
$mySQL->fLast();
while(!$mySQL->fIsBOF())
{
$objField = $mySQL->FieldInfo();
echo $objField->name;
echo "
";
$mySQL->fPrev();
}

####################################
## MySQL À» Æ÷ÇÔÇÏ¿© È°¿ëÇÏ´Â ¿¹Á¦
## °ü¸®ÀÚÀÇ Ãß°¡,°ü¸® µîÀÇ ¿ªÇÒÀ» °®´Â
## Ŭ·¡½º
## ¸¸µçÀÌ : ±è¼ºÃ¶
## ¿¬ ¶ô : paranwave@korea.com
## ¿¬ ¶ô : paranwave@hanmail.net
####################################

include ("/home/paranwave/public_html/class/class.Mysql.php");

class CAdmin extends CObject
{
var $m_mySQL;
var $m_szAdminTableName;
function CAdmin($szTableName="admin", $szClassName="CAdmin")
{
$this->m_mySQL = new CMysql;
$this->m_mySQL->Connect("localhost","paranwave","paranwave","paranwave");
$this->m_szAdminTableName = $szTableName;
CObject::CObject($szClassName);
}
function __CAdmin(&$objInstance)
{
if(is_object($objInstance))
{
if(is_object($objInstance->m_mySQL))
{
unset($objInstance->m_mySQL);
}
unset($objInstance);
}
}
function IsAdmin($szId, $szPw)
{
$bReturn = false;
if($this->m_mySQL->IsConnected())
{
$szQuery = "select count(*) as IsOK from {$this->m_szAdminTableName} where id=``{$szId}`` and pw=``{$szPw}``";
$this->m_mySQL->Query($szQuery);
if($this->m_mySQL->Field("IsOK"))
{
$bReturn = true;
}
$this->m_mySQL->FreeResult();
}
return $bReturn;
}
function AddAdmin($szId,$szPw,$szName,$szEmail)
{
$bReturn=false;
if($this->m_mySQL->IsConnected())
{
$szQuery = "insert into {$this->m_szAdminTableName}(id,pw,name,email) values(``{$szId}``,``{$szPw}``,``{$szName}``,``{$szEmail}``)";
if($this->m_mySQL->Query($szQuery))
{
$bReturn = true;
}
}
return $bReturn;
}
function DeleteAdmin($szId,$szPw)
{
$bReturn=false;
if($this->m_mySQL->IsConnected())
{
$szQuery = "delete from admin where id=``{$szId}`` and pw=``{$szPw}``";
if($this->m_mySQL->Query($szQuery))
{
$bReturn = true;
}
}
return $bReturn;
}
}

$myAdmin = new CAdmin;
if($myAdmin->IsAdmin("admin","1234")) echo "°ü¸®ÀÚÀÔ´Ï´Ù"; else echo "°ü¸®ÀÚ°¡ ¾Æ´Õ´Ï´Ù";
if($myAdmin->AddAdmin("paran3","1234","±è¼ºÃ¶","paranwave@korea.com")) echo "°ü¸®ÀÚ¸¦ Ãß°¡Çß½À´Ï´Ù"; else echo "°ü¸®ÀÚ¸¦ Ãß°¡ÇÏÁö ¸ø Çß½À´Ï´Ù";
if($myAdmin->DeleteAdmin("paran3","1234")) echo "»èÁ¦Çß½À´Ï´Ù"; else echo "»èÁ¦ÇÏÁö ¸ø Çß½À´Ï´Ù";
$myAdmin->__CAdmin(&$myAdmin);

//////////////////////////////////////////////////////////
//BAD USE $myAdmin->m_mySQL->Query("select * from admin");
//BAD USE $myAdmin->m_mySQL->First();
//BAD USE while(!$myAdmin->m_mySQL->IsEOF())
//BAD USE {
//BAD USE echo $myAdmin->m_mySQL->Field("name");
//BAD USE echo $myAdmin->m_mySQL->Field("id");
//BAD USE echo $myAdmin->m_mySQL->Field("pw");
//BAD USE echo $myAdmin->m_mySQL->Field("email");
//BAD USE $myAdmin->m_mySQL->Next();
//BAD USE }
//////////////////////////////////////////////////////////

[CUtil Ŭ·¡½º ¿¹]
# $myUtil = new CUtil
# if($myUtil->IsValidEMail("paranwave@korea.com")) echo "t"; else "f"; // t¸¦ Ãâ·Â
# if($myUtil->IsValidHttp("http://teambus.pe.kg")) echo "t"; else "f"; // t¸¦ Ãâ·Â
# if($myUtil->IsValidHttp("teambus.pe.kg")) echo "t"; else "f"; // f¸¦ Ãâ·Â
# if($myUtil->IsDigit("1")) echo "t"; else "f"; // t¸¦ Ãâ·Â
# if($myUtil->IsDigit("a")) echo "t"; else "f"; // f¸¦ Ãâ·Â
# if($myUtil->IsSpace(" ")) echo "t"; else "f"; // t¸¦ Ãâ·Â
# if($myUtil->IsEmpty("")) echo "t"; else "f"; // t¸¦ Ãâ·Â
# if($myUtil->IsEmpty(" ")) echo "t"; else "f"; // t¸¦ Ãâ·Â
# if($myUtil->IsEmpty(" a ")) echo "t"; else "f"; // f¸¦ Ãâ·Â
# $myUTIL->SetHMBoxAction("./HtmlMessageBox.php");
# $myUtil->HtmlMessageBox("ȸ¿ø´Ô!!!
ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù","ȸ¿øÁ¤º¸¿À·ù","http://www.w.w/idpwcheck.php");
# $myUtil->SetSpace(5); //html ÆÄÀϳ»¿¡       ¸¦ Ãâ·ÂÇÑ´Ù

[CMail Ŭ·¡½º¿¹]
# ¸ÞÀϺ¸³»±â¿¹ ÀÚ·á÷ºÎÀÇ ±â´Éµµ ÀÖ½À´Ï´Ù.
# $myMail = new CMail;
# $myMail->SetTo("paranwave@korea.com","±è¼ºÃ¶");
# $myMail->SetFrom("paranwave@metarica.com", "³ª¾ß");
# $myMail->SetTitle("¾È³çÇϼ¼¿ä^^");
# $myMail->SetBodyFromFile("./MailMessage.txt"); or $myMail->SetBody("ÇÏÇÏÇÏ ¹æ°¡¹æ°¡");
# if($myMail->Send())
# {
# echo "¸ÞÀÏÀ» º¸³Â½À´Ï´Ù";
# }
# else
# {
# echo "¸ÞÀÏÀ» º¸³»Áö ¸øÇß½À´Ï´Ù";
# }

====================================================
³×ƼÁð ÀÇ°ß   ÀÌ¿ëÇϽŠÀÚ·áÀÇ Èı⸦ ÀÚÀ¯·Ó°Ô ÀÛ¼ºÇϼ¼¿ä. (»ó¾÷ÀûÀÎ ±¤°í ¹× µµ¹è¼º ±Û µîÀº »çÀüÅ뺸¾øÀÌ »èÁ¦µÉ ¼ö ÀÖ½À´Ï´Ù.)
³»¿ë ¾ÆÀ̵ð ÀÇ°ß³²±â±â
µî·ÏµÈ ÀÇ°ßÀÌ ¾ø½À´Ï´Ù.
1
À̸§
³»¿ë
:³×¸Â¾Æ¿ä: :È­³ª´Â±º¿ä: :Àá¿Í: :¿ì¿ïÇØ: :À̰ǾƳÄ: :¿ÕÇÏÇÏ: ¿Õ¿ôÀ½~ ³î·¥~
Æò°¡Çϱâ ÈǸ¢ÇÔ ¸Å¿ìÁÁÀ½ ÁÁÀ½ ±¦ÂúÀ½ º¸Åë º°·Î
µµ¹è¹æÁöÅ°
 69404847 º¸ÀÌ´Â µµ¹è¹æÁöÅ°¸¦ ÀÔ·ÂÇϼ¼¿ä.