Friday, January 6, 2017

Javascript : Link pada Button

<form>
    <input TYPE="button" VALUE="Home Page" onclick="window.location.href='http://www.wherever.com'"> 
</form>

Monday, December 26, 2016

Pilih Next Record Atau Previous Record

select * from test where id = 8
union all  
(select * from test where id < 8 order by id desc limit 1) 
union all  
(select * from test where id > 8 order by id asc limit 1) 

Thursday, October 13, 2016

PHP Programming : Code PHP untuk membuang masalah / Remove Exception

"Warning: Cannot modify header information - headers already sent by (output started at" 

Masalah ni selesai apabila saya masukkan code php :

 <?php ob_start(); ?>

Pada permulaan, dan code php :

<?php ob_flush(); ?>

Pada akhir code. Dan segala masalah tersebut selesai.. Terima kasih kepada yang membantu.

PHP Programming : Insert Record

<?php 
require_once('connect.php');

$sql = "INSERT INTO tablename(field1, field2field3) VALUES ('value1', '$value2', '$value3')";
mysql_query($sql,$connect)or die(mysql_error());
?>

PHP Programming : Display Record From MySQL Database

<?php 
require_once('connect.php');

mysql_select_db($database_connect, $connect);
$query_record = "SELECT * FROM tablename WHERE id = '1'";
$record = mysql_query($query_record, $connect) or die(mysql_error());
$row_record = mysql_fetch_assoc($record);
$totalRows_record = mysql_num_rows($record);

?>

//Display Data
<?php echo $row_record['fieldname']; ?>

PHP Programming : Show Record With BreakLine / Paparkan Rekod Dengan Break Line

<?php 
 echo nl2br("Perkataan disini");
?>