Results 1 to 4 of 4

Thread: Problem sending mysql database

  1. #1
    Join Date
    Nov 2008
    Posts
    1,514

    Problem sending mysql database

    I have a little trouble with a script for sending mail and adding data in a database, sending mail that is properly but no record is created in the mysql table

    PHP Code:
    <? php 
      $name_radio  
    $_POST ['name_radio']; 
      
    $name $_POST ['name']; 
      
    $first_name $_POST ['firstname']; 
      
    $function $_POST ['function']; 
      
    $category $_POST ['category']; 
      
    $address $_POST ['address']; 
      
    $PostalCode $_POST ['PostalCode']; 
      
    $city $_POST ['city']; 
      
    $country $_POST ['country']; 
      
    $email $_POST ['email']; 
      
    $code_license $_POST ['code_license']; 
      
    $code_crypt $_POST ['code_crypt']; 
      
    $quicontact "[email protected]"

      
    $headers 'From: "RadioWinners" <[email protected]>'"\n"
      
    $headers .= 'Content-Type: text/html; charset = "utf-8"'"\n"
      
    $headers .= 'Content-Transfer-Encoding: 8bit'

      
    $message '<html> <head> 
      </head> <body> 
      <p> Hi, </p> 
      <p> You receive this email just because a person \ ' 
    record Radio Winners. </p
      <
    img <psrc="http://www.radyonne.com/images/mail/bas-sep.jpg" width="700" height="1"> </p
      
    Name <p> <strongradio: </strong'. $name_radio.' </p
      <
    p> <strongName: </strong'. $name.' </p
      <
    p> <strongFirst Name: </strong'. $firstname.' </p
      <
    p> <strong> Function: </strong'. $function.' </p
      <
    p> <strongCategory: </strong'. $category.' </p
      <
    p> <strongAddress: </strong'. $address.' </p
      <
    p> <strongPostcode: </strong'. $PostalCode.' </p
      <
    p> <strongCity: </strong'. $city.' </p
      <
    p> <strongCountry: </strong'. $country.' </p
      <
    p> <strongEmail: </strong'. $email.' </p
      </
    p
      
    LICENSE <p> <strongCode: </strong'. $code_license.' </p
      <
    p> <strongencrypted code: </ strong'. $code_crypt.' </p
      <
    img <psrc="http://www.radyonne.com/images/mail/bas-sep.jpg" width="700" height="1"> </p
      </
    p
      </
    body> </html'; 

      mail (''. $quicontact.'' '
    Registration RADIO WINNERS', $message, $headers); 

      Mysql_connect ( "gffgfgfg", "fgfgfg", "fgfgf"); 
      mysql_select_db ( "fgfgfgf"); 

      mysql_query ( "INSERT INTO radiowinners VALUES ('', '". 
    $name_radio. "', '". $name. "', '". $first_name. "', '". $function. "', '". $category. " ','". $address. " ','". $PostalCode. " ','". $city. " ','". $country. " ','". $email. " ' , ' ". $code_license."', ' ". $code_crypt."', '"time ()."') "); 
      ?>

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Problem sending mysql database

    Add
    Code:
    or die (mysql_error ());
    after your MySQL functions, it maybe give a hint about the problem.

  3. #3
    Join Date
    May 2008
    Posts
    271

    Re: Problem sending mysql database

    you will create a file:
    _connection.php

    PHP Code:
    <? php 
      $host 
    ='*****'
      
    $user ='****'
      
    $pass =''
      
    $dbase '******' ;
      
    // Connect to server 
      
    $connection mysql_connect ($host $user $pass) or die ("Connection Error"); 
      
    mysql_select_db ($dbase$connection) or die ("Error connecting database"); 
      
    ?>
    And in your pages you will just have to make (early):

    PHP Code:
      <? php 
      
    // Connection comics 
       
    include ( "_connection.php"); 
      
    ?>
    That avoids for all your login codes written in clear in all your pages!

  4. #4
    Join Date
    Nov 2008
    Posts
    1,514

    Re: Problem sending mysql database

    Thank you

    I found my mistake! I got the error message:

    Unknown column 'email' in 'field list'

Similar Threads

  1. Manipulating MySQL database using PHP
    By blueprats in forum Guides & Tutorials
    Replies: 1
    Last Post: 30-04-2010, 04:29 PM
  2. Replies: 3
    Last Post: 07-11-2009, 09:36 PM
  3. Replies: 3
    Last Post: 14-09-2009, 11:47 PM
  4. How to add mysql database to localhost?
    By gazwsx in forum Software Development
    Replies: 3
    Last Post: 01-07-2009, 07:07 PM
  5. Restoring MySQL database
    By Sean J in forum Software Development
    Replies: 5
    Last Post: 18-02-2009, 01:46 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,763,493.83417 seconds with 16 queries