Hi all, i have a problem when my system is not workable if running on the server, but at local host it run as usual without error.. when i want to insert the data it show "Data Not Inserted". Why it happen?

Check your code for errors, or invalid connection information. Without more information from you, nobody can say anything sensible about it.

This file work in local host but do not work when run in server. When run in server view,update,insert user work OK but for this file is not working. Can you help me?

This is my code for file step1_req.php:

include 'template.php';
include 'connection/db_connect.php';
$username = $_GET['username'];

$sql="SELECT * FROM user WHERE username='$username'";

$sql2="SELECT * FROM category";

<style type="text/css">
.style3 {
	color: #6633CC;
	font-size: 18px;
	font-weight: bold;

<form name="form1" method="post" action="db_step1.php?empNo=<?php echo $row['empNo']; ?>">
  <div align="center">
    <table width="367" height="228" border="1" cellpadding="1">
        <td><table width="367" height="41" border="0">
            <td><div align="center" class="style3">Step 1 : Select Category </div></td>
          <table width="368" height="167" border="0">
              <td>Date </td>
              <input name="date_req" type="text" id="date_req" value="<?php $curr_date = date("Ymd"); print $curr_date;?>" size="20" readonly="">
              <input name="dept" type="text" id="dept" value=" <?php echo $row['dept']; ?>" size="20" readonly="">
              <input type="hidden" name="empNo" value=" <?php echo $row['empNo']; ?>"></td>
              <td><input type="hidden" name="misRefId" value=" <?php echo $row['dept'].'-'.$curr_date = date("Ymd")?>"></td>
                <select name="category" id="category">
                  <option value="" selected="selected">-select-</option>
           			while($row2 = mysql_fetch_array($result2)) {
                  <option value="<?php echo $row2['cat_id']; ?>"><?php echo $row2['cat_name']; ?></option>
                  <?php } ?>
              <td> <input name="Next" type="submit" id="Next" value="Next">
              <input type="hidden" name="username" value="<?php echo $username ?>"></td>

<?php include 'copy.php'; ?>

file db_step1.php

<?php extract ($_POST);

$sql='INSERT INTO request set



<script type="text/javascript">
alert("Request already save!");
	window.location='step2_req.php?empNo=<?php echo $empNo ?>';</script>

Thank you "pritaeas"! i already try this code but it still doesn't work..it didn't show any error.. i dont know why it doesn't work when run in server..this is my database connection code :

$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql');

$dbname1 = 'relogs';

Add error reporting to your mysql_connect, mysql_select_db, and mysql_query's, just like line 6 above. Instead of a text, use die(mysql_error())

I got it!! hurm..actually i didn't tick for "null" value in field. Because my 1st page actually insert into certain fields not all that's why i have to give "null" value for the others.

Thank you for pritaeas for giving me help.. :)