Показать сообщение отдельно
Старый 13.10.2002, 03:40     # 4
Tagore
Guest
 
Сообщения: n/a

MySql database "aB"

CREATE TABLE ab_photo (
PhotoID bigint(21) NOT NULL auto_increment,
CatID varchar(21) default '0',
Url varchar(255) default NULL,
Source varchar(255) NOT NULL default '',
Author varchar(255) default '',
Date varchar(255) default '',
PRIMARY KEY (PhotoID),
PRIMARY KEY (Category),
UNIQUE KEY Url (Url)
) TYPE=MyISAM;

CREATE TABLE ab_category (
CatID varchar(21) NOT NULL auto_increment,
Category varchar(255) default NULL,
PRIMARY KEY (Category),
) TYPE=MyISAM;

Pravilno napisal? Mne nuzen photo album v PHP, tojest nuzen ese query - no pravilno li ja rasstavil key? Nuzno, sto bi bilo upravlneie tjipa http://www.anna.ru/go.php?cat=media&id=3 (gde category=-media, i PhotoID=3).


Vot query ....

// My suggested code for go.php (the main page)
<?
mysql_connect("localhost", "aB", "Photoshop6");
mysql_select_db("aB");
$query = mysql_query("SELECT Category FROM aB WHERE id='$QUERY_STRING'");
$row = mysql_fetch_row($query);
mysql_close();
echo "<html>
<FRAMESET cols=\"100%,*\">
<FRAME src=\"$row[0]\">
<FRAME src=\"\">
</FRAMESET>
</html>";
?>