Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19
  1. #11

    Default Re: insert query sa php


    code please.....

  2. #12

    Default Re: insert query sa php

    bitaw posibbile na... if you have phpmyadmin try inserting multiple rows and you will see the query...

  3. #13

    Default Re: insert query sa php

    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);

  4. #14

    Default Re: insert query sa php

    Quote Originally Posted by senpai91 View Post
    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);

    can you do a multiple query without using a loop?

  5. #15

    Default Re: insert query sa php


  6. #16
    Elite Member
    Join Date
    Jun 2010
    Gender
    Male
    Posts
    1,018

    Default Re: insert query sa php

    Nashy ang TS. Or naglibog pa og sabot sa iyang problema.

  7. #17

    Default Re: insert query sa php

    Quote Originally Posted by salbahis View Post
    can you do a multiple query without using a loop?
    and by that you mean? insert by batch?

  8. #18

    Default Re: insert query sa php

    ang pinakadali sa tanan para naa kay duha ka insert kay ing.ani:
    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());
    }
    kaduha na siya mu-insert.

  9. #19

    Default Re: insert query sa php

    Quote Originally Posted by senpai91 View Post
    and by that you mean? insert by batch?
    no insert multiple rows by single query..

  10.    Advertisement

Page 2 of 2 FirstFirst 12

Similar Threads

 
  1. [help]newbie sa php
    By intheb0x in forum Programming
    Replies: 13
    Last Post: 04-06-2011, 12:26 AM
  2. i need ur help in query sa vb
    By skeptic_rob in forum Programming
    Replies: 15
    Last Post: 12-31-2010, 10:38 PM
  3. Replies: 42
    Last Post: 07-10-2009, 03:41 PM
  4. need help sa drop down list in html & php
    By pulchra in forum Programming
    Replies: 8
    Last Post: 10-17-2008, 10:14 PM
  5. sa maka tabang lng.. PHP
    By romano2717 in forum Programming
    Replies: 7
    Last Post: 02-04-2008, 05:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top