code please.....
bitaw posibbile na... if you have phpmyadmin try inserting multiple rows and you will see the query...
hatag daw ang code...simple raman kau ng insert...-sakong nahibaw.an-
sample lang sakong insert....
================================================== =========
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("accsystem", $con);
include("journalentry.html");
$date= date("Y-n-d");
if (isset($_POST['month']))
{
$month = $_POST['month'];
if ($month == 'January') {$month = 'January';}
else if ($month == 'February') {$month = 'February';}
else if ($month == 'March') {$month = 'March';}
else if ($month == 'April') {$month = 'April';}
else if ($month == 'May') {$month = 'May';}
else if ($month == 'June') {$month = 'June';}
else if ($month == 'July') {$month = 'July';}
else if ($month == 'August') {$month = 'August';}
else if ($month == 'September') {$month = 'September';}
else if ($month == 'October') {$month = 'October';}
else if ($month == 'November') {$month = 'November';}
else if ($month == 'December') {$month = 'December';}
else
$month=' ';
}
if (isset($_POST['day']))
{
$day = $_POST['day'];
for($no=0;$no<=32;$no++){
if ($day == '$no') {$day = '$no';}
}
}
if (isset($_POST['year']))
{
$year = $_POST['year'];
if ($year == '2012') {$year = '2012';}
else if ($year == '2013') {$year = '2013';}
else if ($year == '2014') {$year = '2014';}
else if ($year == '2015') {$year = '2015';}
else if ($year == '2016') {$year = '2016';}
else{$year = '2012';}
}
$sql=("INSERT INTO journal_voucher(BANK_DEBIT,BANK_CREDIT, ACCU_INCME, ACCU_PROV, ADJ_ENTRIES, CODE,DATE, MONTH,DAY, YEAR)
VALUES
('$_POST[debit]','$_POST[credit]','$_POST[income]','$_POST[prov]','$_POST[adjentries]','','$date','$month','$day','$year')");
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con);
tan-awa ni, basin naa kay makuha
MySQL Lists: mysql: insert/select for multiple tables...
Nashy ang TS. Or naglibog pa og sabot sa iyang problema.
ang pinakadali sa tanan para naa kay duha ka insert kay ing.ani:
kaduha na siya mu-insert.Code:$sql=("INSERT INTO journal_voucher(BANK_DEBIT,BANK_CREDIT, ACCU_INCME, ACCU_PROV, ADJ_ENTRIES, CODE,DATE, MONTH,DAY, YEAR) VALUES ('$_POST[debit]','$_POST[credit]','$_POST[income]','$_POST[prov]','$_POST[adjentries]','','$date','$month','$day','$year')"); if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } $sql=("INSERT INTO journal_voucher(BANK_DEBIT,BANK_CREDIT, ACCU_INCME, ACCU_PROV, ADJ_ENTRIES, CODE,DATE, MONTH,DAY, YEAR) VALUES ('$_POST[debit]','$_POST[credit]','$_POST[income]','$_POST[prov]','$_POST[adjentries]','','$date','$month','$day','$year')"); if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }
Similar Threads |
|