 |
|
|
 |
 |
|
กำลังร้อนความรู้ มีอะไรเด็ด ๆ เขียนมาซะตัวอย่างก็ดีน่ะครับ เผื่อจะได้เรียนรู้อะไรใหม่ๆ เช่นเดียวกัน 
|
 |
 |
 |
 |
Date :
2010-07-23 12:13:22 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เช่น การรับ-ส่ง parmiter เช่น แปลงข้อมูลจาก sql server เป็น XML ทั้งในรูปแบบ เท็ก และ ฟังก์ชั่น ลองโพทคำถามมานะครับ เดี๋ยวยังไงจะช่วยตอบ
|
 |
 |
 |
 |
Date :
2010-07-23 14:32:22 |
By :
gopasoft392 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แล้วหัดวาดการ์ตูนไปทางไหนคะ
( ช่วยดันๆ ค่ะ )
|
 |
 |
 |
 |
Date :
2010-07-23 17:13:06 |
By :
blurEyes |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
งั้นเปิดเลยแล้วกัน
มี password เข้า hawii-picpost ไหมขอรับ ???
|
 |
 |
 |
 |
Date :
2010-07-23 20:39:17 |
By :
tungman |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ครับ กระผมอยากจะถามเรื่อง php นิดนึง
คืออยากทราบว่า วิธีที่ต้องการใช้ constant หรือ static function ในคลาส ตัวเองในกรณีที่ไม่รู้ หรือไม่อยากพิมพ์ชื่อคลาส ตัวเอง (เพราะชื่อมันยาว [เพราะว่า เฟรมเวอร์คที่ใช้มันคำนวน(ค้นหา)คลาสอัติโนมัติ ตาม ไดเรคทอรี่])
ตัวอย่างเช่น
คลาสชื่อ Controller_Manage_WImage (อันนี้ เราแค่ใช้ new WImage; ในคลาสอื่น มันจะไปค้นหาที่ application/class/controller/manage/wimage.php ซึ่งเราไม่ต้อง new Controller_Manage_WImage; เอง)
ภายใสคลาสมีเมธอดที่ใช้ constant ของคลาสนี้ คือผมต้องใช้ชื่อเต็ม ซึ่งมันยาว
ex. method ที่ใช้ constant ในคลาส ตัวเอง แต่ชื่อมันยาว(เช่น Controller_Manage_WImage::ORIGINAL_PATH) อยากทราบวิธีเรียกชื่อแบบ dynamic แบบสั้นๆ
Code (PHP)
protected function _ss_upload($file, $model, $title = NULL)
{
$image = new Image_GD($file);
// create temp record
$screen_id = $model->new_tmp_ss();
$file_name = 'img'.$screen_id.'.'.Controller_Manage_WImage::SAVE_TYPE;
// save original file fist
$ori_realpath = Controller_Manage_WImage::ORIGINAL_PATH.$file_name;
$image->save($ori_realpath);
// save thumbnail file
$image->resize(Controller_Manage_WImage::THUMBNAIL_WIDTH, Controller_Manage_WImage::THUMBNAIL_HEIGHT, Image::AUTO);
$thumbnail_realpath = Controller_Manage_WImage::THUMBNAIL_PATH.$file_name;
$image->save($thumbnail_realpath);
// update db record
$model->update_tmp_ss($screen_id, $ori_realpath, $thumbnail_realpath, $screen_id, $title);
return true;
}
(คำถาม php ถ้าไม่รู้ หรือไม่มีวิธี ก็ไม่เป็นไรนะคับ)
|
 |
 |
 |
 |
Date :
2010-07-23 20:45:39 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
งานเข้าแล้วครับ....
|
 |
 |
 |
 |
Date :
2010-07-23 20:51:31 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
  
|
 |
 |
 |
 |
Date :
2010-07-23 23:56:30 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมยังติดปัญหา sort order อยู่เลย
field เป็น text (username)
order by username asc
มันออกมาเป็น
a
a1
a10
a2
a3
abcde
... ประมาณนี้
ที่เคยทำได้คือเอา length คลุมก็แก้ได้แค่ตัวอักษรและเลข ถ้ามีตัวอักษรเพียวๆอยู่ด้วย เละ บางทีตัว v ขึ้นมาก่อน abcde...
|
 |
 |
 |
 |
Date :
2010-07-24 07:09:57 |
By :
mr.v |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
protected function _ss_upload($file, $model, $title = NULL)
{
$image = new Image_GD($file);
// create temp record
$screen_id = $model->new_tmp_ss();
$file_name = 'img'.$screen_id.'.'.Controller_Manage_WImage::SAVE_TYPE;
// save original file fist
$ori_realpath = Controller_Manage_WImage::ORIGINAL_PATH.$file_name;
$image->save($ori_realpath);
// save thumbnail file
$image->resize(Controller_Manage_WImage::THUMBNAIL_WIDTH, Controller_Manage_WImage::THUMBNAIL_HEIGHT, Image::AUTO);
$thumbnail_realpath = Controller_Manage_WImage::THUMBNAIL_PATH.$file_name;
$image->save($thumbnail_realpath);
// update db record
$model->update_tmp_ss($screen_id, $ori_realpath, $thumbnail_realpath, $screen_id, $title);
return true;
}
**** แค่เปลี่ยนผาสให้มันเฉยๆนะ เมื่อมีคราสแล้ว จะดึงอะไรออกมาใช้ บางทีเราไม่จำเป็นต้องอิงหลักการเสมอ ลองไปศึกษาเรื่อง oop ดูนะครับ รับรอง เรื่องแค่นี้ไม่ยากเกินไป ถ้าไม่ได้จริงๆเดี๋ยวจะช่วย
|
 |
 |
 |
 |
Date :
2010-08-08 15:30:52 |
By :
ZienPHP2009 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมว่าคุณเปิดกระทู้มาให้ชาวบ้านลองของแล้วหละครับ 
|
 |
 |
 |
 |
Date :
2010-08-08 17:43:37 |
By :
PlaKriM |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับ ใช้ self (จริงเคยใช้แล้ว แต่ดันลืม) 
Code (PHP)
protected function _ss_upload($file, $model, $title = NULL)
{
try
{
$image = new Image_GD($file);
// create temp record
$screen_id = $model->new_tmp_ss();
$file_name = 'img'.$screen_id.'.'.self::SAVE_TYPE;
// save original file fist
$ori_realpath = self::ORIGINAL_PATH.$file_name;
$image->save($ori_realpath);
// save thumbnail file
$image->resize(self::THUMBNAIL_WIDTH, self::THUMBNAIL_HEIGHT, Image::AUTO);
$thumbnail_realpath = self::THUMBNAIL_PATH.$file_name;
$image->save($thumbnail_realpath);
// update db record
$model->update_tmp_ss($screen_id, $ori_realpath, $thumbnail_realpath, $title);
return true;
}
catch (Exception $ex)
{
// fake image file
return false;
}
}
|
 |
 |
 |
 |
Date :
2010-08-08 18:09:46 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
งั้นผมขอฝากคำถามไว้เป็นอยากให้พี่เขียนบนความเกี่ยวกับการทำ BI หน่อยได้มั้ยครับเอาเป็นตัวอย่าง Demo ให้ดูได้เลยยิ่งดี เผื่อมีโอกาสจะได้ลองทำมั่งเจ้าธุรกิจอัฉริยะเนี้ย เห็นเค้าว่าทำใน SQL SERVER ได้สบายๆ
|
 |
 |
 |
 |
Date :
2010-08-09 01:08:45 |
By :
chineji |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รบกวนผู้รู้นิ๊ด......นึงนะค่ะ
พอดี เขียน php อยู๋นิ๊ดนึง (มือใหม่) ใช้ fopen เปิดไฟล์ .txt อยู๋ในเครื่องของเรา พออัพขึ้น เซิฟเวอร์ กำลัง error ซะงั้น เป็นเพราะอะไรค่ะ ช่วยบอกถึงความเป้นไปได้ หลายข้อหน่อยนะค่ะ จะได้กับไปแก้ไขค่ะ ขอบคุณค่ะ
|
 |
 |
 |
 |
Date :
2010-08-09 09:00:22 |
By :
nefer |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เค้าก้อมีปัญหาอ่ะ คือ ข้อมูลมันไม่อัพเดตอ่ะ ช่วยดูให้หน่ออยค่ะ
<? include"ck_session.php";?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title></title>
<link href="../fuction/style_1.css" rel="stylesheet" type="text/css" />
</head>
<body><center>
<? include"header.php";?>
<? include"menu_top.php";?>
<? include"menu_tops.php";?>
<table width="1000" border="2" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td width="220" height="410" align="center" valign="top"><? include"menu_lefts.php";?></td>
<td width="780" align="center" valign="top"><table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<?
$id_customer=$_POST[id_customer];
$customer_name=$_POST[customer_name];
$customer_detail=$_POST[customer_detail];
$sql_customer="UPDATE 'id_customer' SET
'id_customer='$id_customer';
'customer_name'='$customer_name';
'customer_detail'='$customer_detail';
WHERE 'id_customer'=$id LIMIT 1;";
$res_customer=mysql_db_query($dbname,$sql_customer);
echo"<meta http-equiv='refresh' content='4 ; url=customer.php;' >\n";
echo" CUSTOMER. COMPLETE .. Wait...Go To CUSTOMER. Page...";
?></td>
</tr>
</table>
<? include"menu_foot.php";?>
<blockquote> </blockquote>
</body>
</html>
|
 |
 |
 |
 |
Date :
2010-08-09 09:12:13 |
By :
assis design |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
$id_customer=$_POST[id_customer];
$customer_name=$_POST[customer_name];
$customer_detail=$_POST[customer_detail];
$sql_customer="UPDATE 'id_customer' SET
// echo ค่าออกมาก่อนน่าจะดีกว่านะครับ เพราะจะได้รู้ว่าค่าที่เราส่งมานั้นมีหรือไม่ เช่น
echo "$id_customer";// ถ้ามีค่าแล้ว ค่อยมาเขียนคำสั่ง SQL จะดีกว่านะครับ
|
 |
 |
 |
 |
Date :
2010-08-09 10:55:12 |
By :
popnakub |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
thank
|
 |
 |
 |
 |
Date :
2010-08-10 21:10:03 |
By :
nattaplon |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
thank
|
 |
 |
 |
 |
Date :
2010-08-10 22:29:37 |
By :
anglemans |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|