Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2009
    Posts
    93
    Plugin Contributions
    0

    Default How to write in new database table?

    I have created a new database table with the name 'table'. Now i'm trying the following code to write the data into the fields:

    if (isset ($_POST['request'])) {

    $F1 = $_POST['F1'];
    $F2 = $_POST['F2'];
    $F3 = $_POST['F3'];
    $F4 = $_POST['F4'];

    $sql_data_array = array('F1' => zen_db_prepare_input($_POST['F1']),
    'F2' => zen_db_prepare_input($_POST['F2']));

    zen_db_perform('table', $sql_data_array);

    $db->Execute("insert into requests (F1, F2, F3, F4) values ('".$F1."', '"$F2."', '".$F3."', '".$F4. "')");
    }


    When i press the submit button i get blank page.
    Where is the mistake?
    Last edited by fawad123; 22 Sep 2010 at 08:02 AM.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: How to write in new database table?

    Quote Originally Posted by fawad123 View Post
    $sql_data_array = array('F1' => zen_db_prepare_input($_POST['F1']),
    'F2' => zen_db_prepare_input($_POST['F2']));

    zen_db_perform('table', $sql_data_array);
    That does the same as:
    Quote Originally Posted by fawad123 View Post
    $db->Execute("insert into requests (F1, F2, F3, F4) values ('".$F1."', '"$F2."', '".$F3."', '".$F4. "')");
    }
    So, you're duplicating your efforts.
    Quote Originally Posted by fawad123 View Post
    When i press the submit button i get blank page.
    Where is the mistake?
    Here's a tutorial on finding your mistakes that cause blank pages: https://www.zen-cart.com/tutorials/index.php?article=82
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Oct 2009
    Posts
    93
    Plugin Contributions
    0

    Default Re: How to write in new database table?

    Thank you so much !

 

 

Similar Threads

  1. v153 Transferred database to new site, forgot to upload address_book table.
    By joecooper in forum General Questions
    Replies: 2
    Last Post: 3 Jun 2015, 09:26 AM
  2. v151 how can clean table from the database
    By dmagic in forum General Questions
    Replies: 1
    Last Post: 4 Feb 2014, 06:23 AM
  3. v139h database table project version not found after moving to new GoDaddy server
    By soaringeagle in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 2 Apr 2012, 10:18 PM
  4. how to show data from database table?
    By jibon in forum General Questions
    Replies: 1
    Last Post: 20 Oct 2009, 05:36 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
  •  
disjunctive-egg