TGWSE_GY Posted April 27, 2009 Share Posted April 27, 2009 Okay I am storing images in a mysql table the table setup looks like this: Field Type Collation Null Key Default Extra Privileges Comment ------------------- ------- ---------------- ------ ------ ------- -------------- -------------------- ------- CustID int(9) (NULL) NO (NULL) select,insert,update ImageID int(50) (NULL) NO PRI (NULL) auto_increment select,insert,update ImageType text ascii_general_ci YES (NULL) select,insert,update Image blob (NULL) YES (NULL) select,insert,update DefaultProfileImage int(1) (NULL) YES (NULL) select,insert,update I am wanting to skip ImageID and DefaultProfileImage in my mysql insert statement, and here is the insert statement: mysql_query("INSERT INTO profile_user_images ( CustID,ImageType,Image ) VALUES ($CustID, $Image1Type, $EncodedImage1"); } I thought by not including the column names that mysql would skip them but I was wrong because the record is not even posting. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/155891-solved-skipping-columns/ Share on other sites More sharing options...
Mchl Posted April 27, 2009 Share Posted April 27, 2009 Because you have missing ) at the end. Quote Link to comment https://forums.phpfreaks.com/topic/155891-solved-skipping-columns/#findComment-820567 Share on other sites More sharing options...
TGWSE_GY Posted April 27, 2009 Author Share Posted April 27, 2009 here is the correct mysql query mysql_query("INSERT INTO profile_user_images ( CustID,ImageType,Image ) VALUES ('$CustID', '$Image1Type', '$EncodedImage1')"); and it is still not posting. I am confused because I am not new at this and it should be working Quote Link to comment https://forums.phpfreaks.com/topic/155891-solved-skipping-columns/#findComment-820585 Share on other sites More sharing options...
Mchl Posted April 27, 2009 Share Posted April 27, 2009 Try dislplaying error message, so that we know what it complains about sql_query("INSERT INTO profile_user_images ( CustID,ImageType,Image ) VALUES ('$CustID', '$Image1Type', '$EncodedImage1')") or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/155891-solved-skipping-columns/#findComment-820590 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.