#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    NY, NY,USA
    Posts
    18
    Rep Power
    0
    Here are a couple of lines of code, the top "if" clause is executing, but the mysql_query insert isn't working, but the bottom will work with no problems. The if's are checking to see how many images were uploaded on the previous form. Any ideas what the problem might be?

    if ((ereg("none", $image1) != 1) && (ereg("none", $image2) != 1) && (ereg("none", $image3) == 1)){
    mysql_query ("insert into case_studies (project_id,abstract,blurb,logo,screen_capture1,site_url,logo_yellow,related1,related2,related3,rela ted4,related5) values ('$proj_id','$abstract','$blurb','$newlogo','$newimage2','$site_url','$newlogoyellow','$related1','$ related2','$related3','$related4','$related5')");
    print "2"; //to check to make sure this is executing
    }

    if ((ereg("none", $image1) != 1) && (ereg("none", $image2) == 1) && (ereg("none", $image3) == 1)){
    mysql_query ("insert into case_studies (project_id,abstract,blurb,logo,screen_capture1,site_url,logo_yellow,related1,related2,related3,rela ted4,related5) values ('$proj_id','$abstract','$blurb','$newlogo','$newimage2','$site_url','$newlogoyellow','$related1','$ related2','$related3','$related4','$related5')");
    print "1"; //to check to make sure this is executing
    }
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    I don't see anything wrong but then again looking at someone else's code makes me cross-eyed

    add:

    print mysql_error();

    after each query to see what the problem is. This will print the error that mysql is returning as there must be something it doesn't like about the query if the "2" is printing and it isn't inserting.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    36
    Rep Power
    15
    seing only the snipet and none of the db might I suggest make sure the db is conected by calling up a record and print it. if you have not done so.

Similar Threads

  1. get stuff from apache web server
    By farhad in forum Apache Development
    Replies: 2
    Last Post: February 11th, 2004, 01:38 AM
  2. Images not ligning up
    By Jhorra in forum HTML Programming
    Replies: 18
    Last Post: January 22nd, 2004, 11:29 PM
  3. help positioning stuff with CSS
    By edman007 in forum CSS Help
    Replies: 2
    Last Post: December 7th, 2003, 07:52 AM
  4. return function value to CSS
    By subatta in forum CSS Help
    Replies: 13
    Last Post: November 25th, 2003, 02:34 PM
  5. Random links generation / display - HELP
    By Nocturnal in forum PHP Development
    Replies: 0
    Last Post: October 28th, 2003, 11:04 PM

IMN logo majestic logo threadwatch logo seochat tools logo