<?php require_once('Connections/Myconnect.php'); $sql ="SELECT * FROM device"; $result = mysql_query($sql) or die (mysql_error()); ?> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <table border="1"> <tr> <th>No</th> <th>Hostname</th> <th>Location</th> <th>Equipment Type</th> <th>Brand</th> <th>Model</th> </tr> <?php while ($fetch = mysql_fetch_assoc($result)){ ?> <tr> <td><?php echo $fetch['No']?></td> <td><?php echo $fetch['H_name']?></td> <td><?php echo $fetch['Location']?></td> <td><?php echo $fetch['E_type']?></td> <td><?php echo $fetch['Brand']?></td> <td><?php echo $fetch['Model']?></td> <?php } ?> </table> </body> </html>
<?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_Myconnect = "localhost"; $database_Myconnect = "projectmoc"; $username_Myconnect = "root"; $password_Myconnect = ""; $Myconnect = mysql_pconnect($hostname_Myconnect, $username_Myconnect, $password_Myconnect) or trigger_error(mysql_error(),E_USER_ERROR); ?>
function write_log($msg){ fwrite($f=fopen('log_script.txt', 'a'), $msg."\n"); fclose($f); }
$sql_statement = 'select * from table'; write_log( 'line no 20 ' . '$sql_statement=' . $sql_statement); $db->query($sql_statement) or die( $db->error); write_log('line no 22 pass query');
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง