aim25 Posted June 26, 2007 Share Posted June 26, 2007 Well i was just wondering if there was any way to actually upload the image to the database, and opposed to putting the image somewhere else and recording its url and other info in a table. Quote Link to comment Share on other sites More sharing options...
Wildbug Posted June 26, 2007 Share Posted June 26, 2007 Sure, you can put the data in a PHP variable and INSERT it into a MySQL BLOB column as you would normally. Use mysql_real_escape_string() to escape anything that would break the query. $image = file_get_contents('image location...'); // or from $_FILES or whatever mysql_query(sprintf('INSERT INTO images (image) VALUES ("%s")',mysql_real_escape_string($image)); That simple example should work. Quote Link to comment 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.