|
|
|
ช่วยมาแนะนำเราทำ list menu หน่อยคะ ไม่รู้ว่าจะเลี่มต่รงไหน |
|
|
|
|
|
|
|
Capture หน้าจอมาให้ดูหน่อยครับ
|
|
|
|
|
Date :
2012-05-31 10:17:10 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
นี้เป็นแบอย่างที่โชคะ
Code (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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<? date_default_timezone_set("Asia/Bangkok"); ?>
<p>
<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
$strSQL = "SELECT * FROM shortcode order by ShortcodeName DESC ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
</p>
<table width="932" border="2">
<p> </p>
<tr div align="left" bordercolor="#FF0033" bgcolor="#FFCCFF" ><font size="4" color="#0000FF">Date Time:<?
echo date ("Y-m-d H:i:s");?> </font></tr> // ส่วนเวลา
<tr> <B>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"><div align="center">Shortcode_id</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"> <div align="center">Company_name</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"> <div align="center">Effect-time</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"> <div align="center">Expire-time</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"> <div align="center">tel</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"> <div align="center">Delete</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"> <div align="center">Edit</div></font></th>
</B></tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><div align="center"><?=$objResult["ShortcodeName"];?></div></td>
<td><div align="center"><?=$objResult["Company"];?></div></td>
<td><div align="center"><?=$objResult["Effect_time"];?></div></td>
<td><div align="center"><?=$objResult["Expire_time"];?></div></td>
<td align="center"><?=$objResult["Tel"];?></td>
<td align="center"><a href="JavaScript:if(confirm('Confirm Delete?')==true){window.location='phpMySQLDeleteRecord.php?ShortID=<?=$objResult["ShortcodeName"];?>';}">Delete</a></td>
<td align="center" ><a href="phpMySQLEditRecordForm.php?ShortID=<?=$objResult["ShortcodeName"];?>">Edit</a></td>
</tr>
<?
}
?>
</table>
<?
mysql_close($objConnect);
?>
</body>
</html>
|
|
|
|
|
Date :
2012-05-31 10:37:12 |
By :
Cat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอดู DB ได้ไหมครับ
วิธี Capture หน้าจอ
- ถ้าเป็น PC ก็กดปุ่ม PrtSC SysRq ได้เลยครับ
- ถ้าเป็น Notebook บางรุ่นก็ต้องกด ปุ่ม fn ค้างไว้แล้วกดปุ่ม PrtSC ครับ บางรุ่นก็กดปุ่ม PrtSC ได้เลย ^^?
|
|
|
|
|
Date :
2012-05-31 14:15:00 |
By :
keng_ds |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มีอยู่ 2table แบบนี้นะ .ต้องกาน list มี 2 option คือ CRBTและ Shortcode
เมี่อติกเลีอกที่ list เอา CRBT :อยู่ด้านล่างก็จะสะแดงข้อมูลเป็นตตรางของ CRBT
CREATE TABLE `shortcode` (
`ShortcodeName` varchar(8) NOT NULL,
`Company` varchar(50) NOT NULL,
`Effect_time` date NOT NULL,
`Expire_time` date NOT NULL,
`Tel` int(11) NOT NULL,
`Short_iD` int(11) NOT NULL auto_increment,
PRIMARY KEY (`Short_iD`)
)
ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=81
Table structure for table `CRBT`
--
CREATE TABLE `CRBT` (
`Company` varchar(50) NOT NULL,
`Effect_time` date NOT NULL,
`Expire_time` date NOT NULL,
`Tel` int(11) NOT NULL,
`CRBT_iD` int(11) NOT NULL auto_increment,
PRIMARY KEY (`Short_iD`)
)
ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=81
|
|
|
|
|
Date :
2012-05-31 14:37:56 |
By :
Cat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ดู code นี้ไห้ด้วยนะเราลองทำแบบพี่ วิน แนะนำแล้วมัน error นะ
มัน error ว่าError Query [SELECT * FROM shortcode WHERE 1 ('- Select -' ) ]
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form name="frmSearch" method="post" action="<?=$_SERVER['SCRIPT_NAME'];?>">
<table width="599" border="1">
<tr>
<th>Select
<select name="ddlSelect" id="ddlSelect">
<option>- Select -</option>
<option value="Shortcode" <?if($_POST["ddlSelect"]=="Shorcode"){echo"selected";}?>>short</option>
<option value="CRBT" <?if($_POST["ddlSelect"]=="Name"){echo"selected";}?>>CR</option>
<option value="Email" <?if($_POST["ddlSelect"]=="Email"){echo"selected";}?>>US</option>
</select>
</th>
</tr>
</table>
</form>
<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("mydatabase");
// Search By Name or Email
$strSQL = "SELECT * FROM shortcode WHERE 1 ";
if($_POST["ddlSelect"] != "" )
{
$strSQL .= " ('".$_POST["ddlSelect"]."' ) ";
}
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<table width="932" border="2">
<p> </p>
<tr> <B>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"><div align="center">Shortcode_id</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"> <div align="center">Company_name</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"> <div align="center">Effect-time</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"> <div align="center">Expire-time</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"> <div align="center">tel</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"> <div align="center">Delete</div></font></th>
<th width="100" bgcolor="#FFFFFF" bordercolor="#006666"><font size="4"color="#0000FF"> <div align="center">Edit</div></font></th>
</B></tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><div align="center"><?=$objResult["ShortcodeName"];?></div></td>
<td><div align="center"><?=$objResult["Company"];?></div></td>
<td><div align="center"><?=$objResult["Effect_time"];?></div></td>
<td><div align="center"><?=$objResult["Expire_time"];?></div></td>
<td align="center"><?=$objResult["Tel"];?></td>
<td align="center"><a href="JavaScript:if(confirm('Confirm Delete?')==true){window.location='phpMySQLDeleteRecord.php?ShortID=<?=$objResult["ShortcodeName"];?>';}">Delete</a></td>
<td align="center" ><a href="phpMySQLEditRecordForm.php?ShortID=<?=$objResult["ShortcodeName"];?>">Edit</a></td>
</tr>
<?
}
?>
</table>
<?
mysql_close($objConnect);
?>
</body>
</html>
|
|
|
|
|
Date :
2012-05-31 14:39:25 |
By :
Cat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|