ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
i want to create a homepage on my LAN. i have the fotogallery saved on the web.
there are many pictures with thumbnails. i want to save all the links in a mysql database. i would like to write a script that aumatticaly writes them to the database so don't have to copy>>paste about 200 links to a manually insert.
the pictures are saved like this:
pictures are here:
I see a couple of things wrong here, first you have start a php script with <?php and not just <?. Second, to use mysql_select_db() you have to give it a connection to select the database on, for example: mysql_select_db($db_name, $connection); so by putting the mysql_connect into a variable it allows you to pass that connection to select_db and any other connection you may need later.
hhmmm...still no entries i really don't know where's the point. i get no errors but no entries too.
flakzeus, if you have later some time for this, or somebody else, could you just try something else out? maybe another script. i tried youre script, then i tried to modify it, but it's still not working.
The screenshot link is actually empty but the script from flakzeus should add entries to the table foto (the '.jpg' extension misses but anyway the strings should be here in the fields). You did not get any error output from the query ?
Maybe a tip : try to play with the quote (`) in the query. For my part I use quote only for field value and the entire query in double quote.
$query = "INSERT INTO foto (picture, thumb1, thumb2, gallery) VALUES ('$pic','$thumb1',$thumb2','$gallery')";
You right towlie I did not noticed that and also run slackware 9.1 here, same error_log for apache. In slackware php package php.ini is configured to not show error but log them in /var/log/apache/error_log