#1
  1. No Profile Picture
    tigertim
    Guest
    Devshed Newbie (0 - 499 posts)
    Can anyone tell me why I would be getting a save as dialogue box popping up when I hiy the submit button.

    Thanks
    Tim
  2. #2
  3. No Profile Picture
    Hans
    Guest
    Devshed Newbie (0 - 499 posts)
    How about posting some code where the problem occurs.. Maybe then i can help you...
  4. #3
  5. No Profile Picture
    tigertim
    Guest
    Devshed Newbie (0 - 499 posts)
    Ok this is the Php code

    <?php

    $conn = mysql_connect("localhost", "username", "password");

    if (!$conn) {
    print "Unable to connect to MySQL database";
    exit;
    }

    mysql_select_db("jobs"); /* <-- Use correct DB name here */


    /* Create SQL Insert statement */

    $ins = "insert into jobposting (
    job_title, job_classification, job_location, employer_name, salary_range, , education,
    qualifications, other_qualifications, type_of_position, start_date, extras)
    values (
    '$job_title', '$job_classification', '$job_location', '$employer_name', '$salary_range', '$education', '$qualifications',
    '$other_qualifications', '$type_of_position', '$start_date', '$extras')";

    $res = mysql_query($ins, $conn);

    if (!$res) {
    print "Error inserting into database<br>";
    print "<PRE>$ins</PRE>";
    exit;
    }

    print "Thank you";

    ?>
  6. #4
  7. No Profile Picture
    tigertim
    Guest
    Devshed Newbie (0 - 499 posts)
    What is wrong with this script it will not enter into database.

    <?php

    $conn = mysql_connect("localhost", "username", "password");

    if (!$conn) {
    print "Unable to connect to MySQL database";
    exit;
    }

    mysql_select_db("jobs"); /* <-- Use correct DB name here */


    /* Create SQL Insert statement */

    $ins = "insert into jobposting (
    job_title, job_classification, job_location, employer_name, salary_range, , education,
    qualifications, other_qualifications, type_of_position, start_date, extras)
    values (
    '$job_title', '$job_classification', '$job_location', '$employer_name', '$salary_range', '$education', '$qualifications',
    '$other_qualifications', '$type_of_position', '$start_date', '$extras')";

    $res = mysql_query($ins, $conn);

    if (!$res) {
    print "Error inserting into database<br>";
    print "<PRE>$ins</PRE>";
    exit;
    }

    print "Thank you";

    ?>
  8. #5
  9. No Profile Picture
    PAV
    Guest
    Devshed Newbie (0 - 499 posts)
    It will not enter into the database because you assign the query into the variable $res, but do not execute it.
    Just type mysql_query(..) and it performs the query.

    Regards, Peter
  10. #6
  11. No Profile Picture
    PAV
    Guest
    Devshed Newbie (0 - 499 posts)
    It will not enter into the database because you assign the query to the variable $res, but do not execute it.
    Just type mysql_query(..); and it performs the query.

    Regards, Peter
  12. #7
  13. No Profile Picture
    rod k
    Guest
    Devshed Newbie (0 - 499 posts)
    Uh, PAV, isn't that what:
    $res = mysql_query($ins, $conn);
    does?

    Tim,

    I don't see anything obviously wrong with your code. In addition to printing the query on a failure, you should print mysql_error(); so you can see the mysql error message.

    If you still can't figure out what is wrong, post the error message here.

Similar Threads

  1. Access: list box/combo box "After Update" problems
    By hlove in forum Database Management
    Replies: 2
    Last Post: January 2nd, 2004, 01:22 AM
  2. Java Print - without dialogue box
    By Phazula in forum HTML Programming
    Replies: 0
    Last Post: December 12th, 2003, 03:37 AM
  3. simulating save as dialogue box!
    By Deepali in forum ASP Programming
    Replies: 1
    Last Post: November 9th, 2003, 10:51 PM
  4. changing the buttons in the message box
    By crackerweb in forum Visual Basic Programming
    Replies: 6
    Last Post: October 23rd, 2003, 06:36 PM
  5. Save As dialogue box to download images
    By mooliMooli in forum HTML Programming
    Replies: 0
    Last Post: October 14th, 2003, 05:16 PM

IMN logo majestic logo threadwatch logo seochat tools logo