Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

i need help on php mysql

Codes here !

Moderators: macek, egami, gesf

i need help on php mysql

Postby surfacesicks » Wed Jun 26, 2013 6:01 pm

out.JPG
out.JPG (45.98 KiB) Viewed 620 times
dear masters, need help on how to do the coding like below image, its like when you enter the info in the form, it will display the below item (highlite in red) those info are from sql server, hope anyone can help me with this..i am totaly lost... :?
surfacesicks
New php-forum User
New php-forum User
 
Posts: 5
Joined: Wed Jun 26, 2013 5:55 pm

Re: i need help on php mysql

Postby surfacesicks » Mon Jul 01, 2013 4:05 pm

Hell OO...not much help here...hell oo...?? :help: :help:
surfacesicks
New php-forum User
New php-forum User
 
Posts: 5
Joined: Wed Jun 26, 2013 5:55 pm

Re: i need help on php mysql

Postby johnj » Mon Jul 01, 2013 8:36 pm

Go ahead and create that form. When a user fills the form, use ajax to transfer those input to a php script which will call mysql, get the details from the database and populate back on the page below the form.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: i need help on php mysql

Postby surfacesicks » Mon Jul 01, 2013 9:54 pm

that exactly what i want to do..but the problem here is how?
surfacesicks
New php-forum User
New php-forum User
 
Posts: 5
Joined: Wed Jun 26, 2013 5:55 pm

Re: i need help on php mysql

Postby johnj » Mon Jul 01, 2013 10:20 pm

Here is an example:http://www.w3schools.com/php/php_ajax_livesearch.asp
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: i need help on php mysql

Postby surfacesicks » Mon Jul 01, 2013 11:08 pm

<?php
include "function.php";

if(isset($_POST['add_serial'])){
$date = date("Y-m-d H:i:s");
$data = "'".$_POST['out_location']."','".$date."','".$_POST['out_qty']."','".$_POST['out_wo']."','";
$data .= $_POST['reciever']."','".$_POST['Ship_to']."','";
$data .= $_POST['out_serial']."','0'";
$column = "(`out_location`, `out_qty`, `out_wo`, `out_serial`, `Receiver`, `ship_to`, `remark`, `tmp`)";
$sql = "INSERT INTO kwip ".$column." VALUES(".$data.")";
insert_data_sql($sql);
exit;
}

if(isset($_POST['change_status'])){
$sql = "UPDATE kwip SET tmp='1' WHERE Serial='".$_POST['serial_no']."'";
insert_data_sql($sql);
exit;



function add_serial(){
var serial = $('#serial_array').val();
var serial_array = serial.split(',');
for (var i=0;i<serial_array.length;i++)
{
$.post("checkout.php", { serial_no: serial_array[i], change_status: "change" } );
}
location.reload();
}
function add_serial_tmp() {
var out_location= $('#out_location').val();
var out_qty= $('#out_qty').val();
var out_wo= $('#out_wo').val();
var out_serial= $('#out_serial').val();
var reciever= $('#Reciever').val();
var ship_to= $('#ship_to').val();
var remark= $('#remark').val();
$.post("checkout.php", {
out_location: out_location,
out_qty: out_qty,
out_wo: out_wo,
out_serial: out_serial,
reciever: reciever,
ship_to: ship_to,
remark: remark,
add_serial: "add"
})
.done(function (data) {
if (data = '0') {
$('#serial_holder tr:last').after('<tr id="so-' + so + '"><td>' + so + '</td><td><button onclick="delete_serial(\'$this\')">Delete</button></td></tr>');
var serial_array = $('#serial_array').val();
if(serial_array == '0'){
$('#serial_array').val(so);
}else{
$('#serial_array').val($('#serial_array').val()+','+so);
}
} else {
alert('error');
}
});
}

$(function () {

});
</script>
</head>
<body>

<p align="center" class="style1"><img src="../bannerLogo.png" width="1006" height="87" /><span class="style3"><a href="mainpage.css">Menu</a> <a href="report"></a></span> </p>
<p align="center" class="style1">Board Check-Out Information </p>
<table width="1000" border="0" align="center" bordercolor="#666666" background="../grey.jpg" bgcolor="#FFFFCC">
<tr>
<td bgcolor="#666666">&nbsp;</td>
<td nowrap bgcolor="#666666">&nbsp;</td>
</tr>
<tr>
<td width="414">
<strong>Out_Location</strong>
<label for="select"></label>
<label for="select"></label>
<select name="out_location" id="out_location">
<option value="SELECT">SELECT</option>
<option value="FG">FG</option>
<option value="Intel">Intel</option>
<option value="Production">Production</option>
</select>
</td>
<td width="570" nowrap><strong>Out_Qty</strong>
<label for="textfield"></label>
<input type="text" name="invoice" id="out_qty" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td nowrap>&nbsp;</td>
</tr>
<tr>
<td><strong>Out_Serial</strong>
<label for="label"></label>
<label for="Submit"></label>
<label for="label"></label>
<input type="text" id="out_serial" />
<input onclick="add_serial_tmp();" id="add_in" type="button" id="add_in" value="add" />
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td nowrap bgcolor="#666666">&nbsp;</td>
<td nowrap bgcolor="#666666">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td nowrap>&nbsp;</td>
</tr>
<tr>
<td>

<td nowrap><strong>Reciever </strong>
<label for="textfield"></label>
<input name="reciever" type="text" id="reciever" value="" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td nowrap>&nbsp;</td>
</tr>
<tr>
<td height="30"><strong>Ship_To</strong>
<label for="textfield"></label>
<input type="text" name="ship_to" id="ship_to" />
</td>
<td nowrap><strong>Remark</strong>
<label for="textfield"></label>
<input type="text" name="remark" id="remark" />
</td>
</tr>
<tr>
<td bgcolor="#666666">&nbsp;</td>
<td nowrap bgcolor="#666666">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td nowrap>&nbsp;</td>
</tr>
<tr>

<td><label for="Submit"></label>
<input onclick="add_serial();" name="Submit2" type="submit" id="Submit2" value="Board Check Out!" />
</td>
<td nowrap>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td nowrap>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#666666">&nbsp;</td>
<td nowrap bgcolor="#666666">&nbsp;</td>
</tr>
</table>
<input type="hidden" id="serial_array" value="0">

<table id="serial_holder" width="500">
<th colspan="2" bgcolor="grey" align="left">Serial</th>
<tr>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>





this is what i did..any comment?
surfacesicks
New php-forum User
New php-forum User
 
Posts: 5
Joined: Wed Jun 26, 2013 5:55 pm

Re: i need help on php mysql

Postby johnj » Thu Jul 04, 2013 12:14 am

if that is what you want and if it is working then I have no comments.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: i need help on php mysql

Postby surfacesicks » Wed Jul 31, 2013 6:40 pm

its not working... :help: :help: :help:
surfacesicks
New php-forum User
New php-forum User
 
Posts: 5
Joined: Wed Jun 26, 2013 5:55 pm

Re: i need help on php mysql

Postby johnj » Tue Aug 06, 2013 11:33 pm

What is the problem, what is the error that you are getting?
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: i need help on php mysql

Postby ashleyco » Tue Sep 10, 2013 1:14 am

that exactly what i want to do..
ashleyco
New php-forum User
New php-forum User
 
Posts: 3
Joined: Tue Sep 10, 2013 1:10 am

Re: i need help on php mysql

Postby ashleyco » Sun Nov 10, 2013 7:50 pm

what is the error that you are getting?
ashleyco
New php-forum User
New php-forum User
 
Posts: 3
Joined: Tue Sep 10, 2013 1:10 am


Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron