source code of MES Data
<HTML>
<HEAD>
<TITLE>TELOGS</TITLE>
</HEAD>
<BODY>
<?php
/* command line parameters: wget "http://localhost/query.php?action=query&sn=123" -O get1.html */ $act=$_GET["action"];
/* http://localhost/query.php?action=query&sn=123 */
if ($act == "query"){
$serialnumber=$_GET["sn"]; $con = mysql_connect("localhost","root","123456");
if (!$con){
die('Could not connect: ' . mysql_error());
} mysql_select_db("test", $con);
$sql = "SELECT * FROM testlogs where Serial_number='$serialnumber'";
$result = mysql_query($sql);
if (mysql_num_rows($result) != "0" ){
while($row = mysql_fetch_array($result))
{
echo $row['Serial_number'] . "|" . $row['Mac_addr']."|". $row['OA_KEY']."\n";
}
}else{
echo "No data of this serial number=".$serialnumber;
}
mysql_close($con);
}
?> <?php
/* http://localhost/query.php?action=add&sn=123&mac=eeee&oakey=123 */
if ($act == "add"){ $serialnumber=$_GET["sn"];
$macaddr=$_GET["mac"];
$oakey=$_GET["oakey"]; $con = mysql_connect("localhost","root","123456");
if (!$con){
die('Could not connect: ' . mysql_error());
} mysql_select_db("test", $con);
$sql="INSERT INTO testlogs (Serial_number, Mac_addr, OA_KEY) values ('$serialnumber','$macaddr','$oakey')";
if(mysql_query($sql)){
echo "Add data Passed";
}else{
echo "Add data failed";
}
mysql_close($con);
}
?>
</BODY>
</HTML>
版权声明:本文博主原创文章。博客,未经同意不得转载。
source code of MES Data的更多相关文章
- Memcached source code analysis (threading model)--reference
Look under the start memcahced threading process memcached multi-threaded mainly by instantiating mu ...
- Learning from the CakePHP source code - Part I
最近开始痛定思痛,研究cakephp的源码. 成长的路上从来没有捷径,没有小聪明. 只有傻傻的努力,你才能听到到成长的声音. 下面这篇文章虽然过时了,但是还是可以看到作者的精神,仿佛与作者隔着时空的交 ...
- Source Code Review
1.berfore we talking abnout the Source Code review,here's what we want to know about the most popula ...
- HashMap source code view(1)
前言 HashMap source code view 类注释 Hash table based implementation of the Map interface. This implement ...
- How to compile and install Snort from source code on Ubuntu
http://www.tuicool.com/articles/v6j2Ab Snort is by far the most popular open-source network intrusio ...
- CRC32 Source Code
/* The Quest Operating System * Copyright (C) 2005-2010 Richard West, Boston University * * This pro ...
- attack source code
不废话,直接上代码, 先看截图use pictures;
- Tree - AdaBoost with sklearn source code
In the previous post we addressed some issue of decision tree, including instability, lack of smooth ...
- Tree - Decision Tree with sklearn source code
After talking about Information theory, now let's come to one of its application - Decision Tree! No ...
随机推荐
- PHPExcel 导出
<?php include '../init.inc.php'; include "../db.inc.php"; /* @func 引入类 */ include ROOT. ...
- servlet操作数据库
工具:myeclipse 数据库工具:mysql java ee操作数据库,首先要导入数据库驱动文件,我用的是mysql 刚开始,很多人代码正确但是就是连接不上,原因就是忘了驱动文件的导入. 我的驱动 ...
- 加装 ImageMagick 性能更佳!
1. 下载 Download ImageMagick 以此文件ImageMagick-6.9.1-10-Q16-x64-dll-win进行,第二次开发的研发 2. 安装 Install ImageMa ...
- cocoapod的安装与使用
cocoaPods的使用 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ...
- android-意图Intent
Android基本的设计理念是鼓励减少组件间的耦合,因此Android提供了Intent (意图) ,Intent提供了一种通用的消息系统,它允许在你的应用程序与其它的应用程序间传递 Intent 来 ...
- Oracle10g--plSql命令
每天学点Oracle10g--plSql命令 附录B SQL*PLUS Sql*plus 中使用绑定变量: sql> variable x number; sql> exec :x := ...
- 在qt下获取屏幕分辨率
1,在Windows下可以使用 GetSystemMetrics(SM_CXSCREEN);GetSystemMetrics(SM_CYSCREEN) 获取. 2,在Linux下可以使用XDisp ...
- Error inflating class android.support.v7.widget.Toolbar
建立程序的时候出现的错误 style.xml中的 <!-- Base application theme. --> <style name="AppTheme" ...
- Spring 拦截器实现事物
Spring+Hibernate的实质:就是把Hibernate用到的数据源Datasource,Hibernate的SessionFactory实例,事务管理器HibernateTransactio ...
- Convert Sorted List to Binary Search Tree ------C++ 递归创建平衡二叉查找树
有序链表 0->1->2->3->4->5 转换为一个二叉排序树.我们在此创建一个平衡二叉排序树 1.先找链表到中间的节点 2.中间节点的val创建一个新的树节点Tree ...