To connect to a MySQL database you need something to connect to it, in this case I'll use PHP but you can do it in other ways:
PHP Code:
<?php
$host = "host"; // Host server name here
$user = "user"; // The username your host gives you to connect to the database
$pass = "pass" // The password your host gives you
$con = mysql_connect($host, $user, $pass)
if(!$con)
{
die("Failed to connect to the server" . mysql_error());
}
// Code for selecting the database follows
?>
You need to know the name of your database to connect to it, and what tables you're going to access.
But as boogyman says, just save the url as a string like so:
PHP Code:
<?php
$image = "images/flyers/advert.jpg";
$result = mysql_query("SELECT * FROM table WHERE image = $image");
while($row = mysql_fetch_array($result))
{
echo $row['image'];
}
?>
Bookmarks