source: temp/trunk/html/test/kakinaka/mysql.php @ 4711

Revision 4711, 695 bytes checked in by kakinaka, 20 years ago (diff)

blank

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2require_once './DB.php'; // PEAR ¤Î DB ¥¯¥é¥¹¤òÆÉ¤ß¹þ¤à
3
4print("start<br>");
5
6$dsn = "mysql://eccube_db_user:[email protected]/eccube_db";
7/*
8print($dsn."<br>");
9
10if(($db = DB::connect($dsn)) == 0){
11  print "¤ª¤ª¤Ã¤È¡ª¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤Ç¤­¤Þ¤»¤ó¡£";
12}
13$result = $db->query("select * from dtb_baseinfo");
14while($row = $result->fetchRow()){
15    print_r($row);
16}
17*/
18
19$sql = "SELECT * FROMdtb_baseinfoWHERE";
20$sql = getMailAddress($sql);
21print_r($sql);
22
23print("end");
24
25// ʸ»úÎó¤ÎÃæ¤Ë¸ºß¤¹¤ë¥á¡¼¥ë¥¢¥É¥ì¥¹¤Î¤ß¤ò¼èÆÀ¤·¡¢ÇÛÎó¤È¤·¤ÆÊÖ¤¹
26function getMailAddress($str){
27    $arrMail = array();
28    preg_match_all("/FROM+([a-zA-Z0-9_\.\+\?-]+WHERE)/", $str, $arrMail);
29    return $arrMail[0];
30}
31
32?>
Note: See TracBrowser for help on using the repository browser.