To show the rows of the table in a php page works.
But i want to show just one field.
The table:
ID - Label - Artist - Name Of Album - Example - More info - Text
The output on the page:
ID - Label - Artist - Name Of Album - Example - More info
Where "More info " has to be a link to get the "Text"
The "Text" has a lot of lines.
How to do?
you only have to output the fields that you want...
i'm confused by the question here.select ID, Label, Artist, Name Of Album, Example, More info from Table where ID = 'some_number'
this will allow it to select only the ID of the row you want.
then in more info you just have the ID put in the link to be sent to the next page to do the same query but with text in the fields you want
select text fomr tabel where ID = '{$_GET['ID']}'
is that what you wnat Peter?I will give it a try... tonight.
I cannot get the ID with the $_GET
In "more info" i have a link:
<a href=http://www.htmlforums.com/archive/index.php/"meer_info.php">meer info </a>
In this meer_info.php:
$res=mysql_db_query("$db","select extra from club WHERE ID = '{$_GET['ID']}';",$dbh);
results in an error:
Notice: Undefined index: ID in c:\program files\easyphp1-7\www\vinyl\meer_info.php on line 16
If i change it to:
$res=mysql_db_query("$db","select extra from club WHERE `ID` = '1' LIMIT 1 ;",$dbh);
it works, but just for ID=1
The table club has 40 rows.
The field "More Info" in a row has to open "meer_info.php"
This "meer_info.php" has to show the extra information.
But just the extra information of this ID.
you have to send it first
<a href=http://www.htmlforums.com/archive/index.php/"meer_info.php?id=1234">meer info </a>
then you can use the $_GET['id']
the error you get is because you didn't define it before you used it. nothing real big.I did
<a href=http://www.htmlforums.com/archive/index.php/"meer_info.php?id=1">meer info </a>
where id=1 is the ID of that row.
But it did not work.
I will try again..... later....
try this too, cause your query is wrong
$res=mysql_db_query("select extra from club WHERE ID = '{$_GET['id']}'",$dbh) or die ("Query Error:". mysql_error());
remember case-sensative so make sure "id" is like what is in the url.It is working...
in the
{$_GET['id']}
i had {$_GET['ID']}
Thx
But i want to show just one field.
The table:
ID - Label - Artist - Name Of Album - Example - More info - Text
The output on the page:
ID - Label - Artist - Name Of Album - Example - More info
Where "More info " has to be a link to get the "Text"
The "Text" has a lot of lines.
How to do?
you only have to output the fields that you want...
i'm confused by the question here.select ID, Label, Artist, Name Of Album, Example, More info from Table where ID = 'some_number'
this will allow it to select only the ID of the row you want.
then in more info you just have the ID put in the link to be sent to the next page to do the same query but with text in the fields you want
select text fomr tabel where ID = '{$_GET['ID']}'
is that what you wnat Peter?I will give it a try... tonight.
I cannot get the ID with the $_GET
In "more info" i have a link:
<a href=http://www.htmlforums.com/archive/index.php/"meer_info.php">meer info </a>
In this meer_info.php:
$res=mysql_db_query("$db","select extra from club WHERE ID = '{$_GET['ID']}';",$dbh);
results in an error:
Notice: Undefined index: ID in c:\program files\easyphp1-7\www\vinyl\meer_info.php on line 16
If i change it to:
$res=mysql_db_query("$db","select extra from club WHERE `ID` = '1' LIMIT 1 ;",$dbh);
it works, but just for ID=1
The table club has 40 rows.
The field "More Info" in a row has to open "meer_info.php"
This "meer_info.php" has to show the extra information.
But just the extra information of this ID.
you have to send it first
<a href=http://www.htmlforums.com/archive/index.php/"meer_info.php?id=1234">meer info </a>
then you can use the $_GET['id']
the error you get is because you didn't define it before you used it. nothing real big.I did
<a href=http://www.htmlforums.com/archive/index.php/"meer_info.php?id=1">meer info </a>
where id=1 is the ID of that row.
But it did not work.
I will try again..... later....
try this too, cause your query is wrong
$res=mysql_db_query("select extra from club WHERE ID = '{$_GET['id']}'",$dbh) or die ("Query Error:". mysql_error());
remember case-sensative so make sure "id" is like what is in the url.It is working...
in the
{$_GET['id']}
i had {$_GET['ID']}
Thx