Forum Moderators: coopster
CREATE TABLE img (id INT NOT NULL auto_increment, url VARCHAR(70) default '#', title VARCHAR(70), description BLOB, PRIMARY KEY(id));
this is index.php that will show the file:
<?php
if(!($id = (int)$_GET["id"])) $id = 1;
mysql_connect("host", "name", "password") or die(mysql_error());
mysql_select_db("dbname") or die(mysql_error());
$sql = "SELECT url, title, description FROM img WHERE id='$id';
$ans = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($ans);
?><html><head>....bla bla</head><body><p><?php echo $row["title"];?></p>
<img src="<?php echo $row['url'];?>"><br><p>
You should also give pages and check if you don't exceed max picture and not write id=0. But I hope this gives you some insight in how to start that
Best regards
Michal Cibor
There shouldn't be any[quote] - it's my mistake.
What you also need is to check if you don't exceed above ids (below is not a problem).
Best regards!
Michal Cibor