cbastian Posted May 15, 2008 Share Posted May 15, 2008 I've got a file that resizes photos and creates thumbs. I'm trying to make it also insert the data into my mysql database. It works if I try to insert certain text, but not variables. Here is what I'm using, right now: mysql_query("INSERT INTO compphotos (imgSrc, imgAlt, imgThumb)VALUES ($sourcefl, 'Gala 2008', $destfilesm)"); if I change the last part to something like: VALUES ('field1', 'field2', 'field3') then it writes those words in the database... Anyone know why it won't write the values of the variables as well? I'm kinda new to this, so this may be a really basic question.Thanks for any help!-Charles... Link to comment Share on other sites More sharing options...
cbastian Posted May 15, 2008 Author Share Posted May 15, 2008 OK I feel stupid, I didn't think I needed to add the single quotes around a variable. Figured this one out myself, thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.