bobber205 Posted September 2, 2006 Share Posted September 2, 2006 I want to create a database of images. I would love to be able to upload images (maybe links) I find while surfing the net while at school. I am often not allowed to use anything but a browser so a page where I could do what I want would be cool (and a good way to get started with mySQL).Advice greatly appreciated. I have several years of casual programming experience, if that makes a difference in links.. :DThanks. Quote Link to comment Share on other sites More sharing options...
bob_the _builder Posted September 2, 2006 Share Posted September 2, 2006 Hi,Create table stuctures to hold the data you would like to hold[code]CREATE TABLE links ( link_id int(5) NOT NULL auto_increment, link_name varchar(50) NOT NULL default '', notes text NOT NULL default '', PRIMARY KEY (link_id)) TYPE=MyISAM;[/code]Then use forms to post the data[code=php:0]// Connection details somewhereif isset($_POST['submit']) { $sql = mysql_query("INSERT INTO links (link_name, notes) VALUES ('".$_POST['links'].", ".$_POST['notes']."')"); echo '<br />URL successfully added';}else{echo '<form id="form" name="links" method="post" action=""> <input type="text" name="textfield" /> <br /><br /> <textarea name="" cols="" rows=""></textarea> <br /><br /> <input name="submit" type="submit" value="submit" /> </form>';}[/code]Only budget concept .. You will need to use 'multipart/form-data' for images/files, store the image names + extension in the database and the images in a folder on your serverhth 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.