|
| url?authid=1 Fra : Ole Madsen |
Dato : 19-06-01 21:13 |
|
vis_artikel.php?authid=1
Værdien kommer fra en anden side, hvor jeg har hentet forfattere ind på
siden i en liste
denne værdi skal jeg have ind i dette:
jeg skal kun have de headers som passer sammen med den authid. Tak for
jeres hjælp
Ole
<?
$db_name = "olemadsen";
$table_name = "headers";
$connection = @mysql_connect("localhost")
or die("Couldn't connect.");
$dbs = @mysql_select_db($db_name, $connection) or die("Could'nt select
database");
$sql = "
select id, headers, dato, authid, textid from $table_name ORDER BY
authid,textid";
$result = @mysql_query($sql, $connection) or die("Could'nt execute query");
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$headers = $row['headers'];
$dato = $row['dato'];
$authid = $row['authid'];
$textid = $row['textid'];
$display_block .="<BR><a
href=\"vis_artikel.php?textid={$row['textid']}\">{$row['headers']}</a><br>\n
";
};
?>
<HTML>
<HEAD>
<TITLE> type_Document_Title_here </TITLE>
</HEAD>
<BODY>
<? echo "$display_block" ?>
</BODY>
</HTML>
| |
Lars Falsig (20-06-2001)
| Kommentar Fra : Lars Falsig |
Dato : 20-06-01 00:47 |
|
> $sql = "
> select id, headers, dato, authid, textid from $table_name ORDER BY
> authid,textid";
Kan laves som :
$sql = "select id, headers, dato, textid from $table_name WHERE authid = '1'
ORDER BY textid";
| |
Ole Madsen (20-06-2001)
| Kommentar Fra : Ole Madsen |
Dato : 20-06-01 13:11 |
|
Lars Falsig <Laf@dhsaps.dk> wrote in message
news:3vRX6.5275$hi6.530585@news000.worldonline.dk...
> > $sql = "
> > select id, headers, dato, authid, textid from $table_name ORDER BY
> > authid,textid";
>
> Kan laves som :
>
> $sql = "select id, headers, dato, textid from $table_name WHERE authid =
'1'
> ORDER BY textid";
Men hvad så hvis authid i urlen er en anden?
Ole
| |
Niels (20-06-2001)
| Kommentar Fra : Niels |
Dato : 20-06-01 13:12 |
|
Just as I expected, Ole Madsen came up with this:
>> $sql = "select id, headers, dato, textid from $table_name WHERE authid = '1'
>> ORDER BY textid";
>
>Men hvad så hvis authid i urlen er en anden?
$sql = "select id, headers, dato, textid from $table_name
WHERE authid = '".$HTTP_GET_VARS["authid"]."' ORDER BY textid";
Niels
--
http://www.niller.f2s.com/ - niLLer's pages, that's my software
http://g4s.dnsq.org/ - when I'm online
g4s ad post dot ocm - new email! (note: it's .com !)
ICQ#: 50187323
| |
|
|