Jump to content

printing links


jermaindefoe

Recommended Posts

Hi every1

 

i am connecting to a table in sql and the looping through with a while ($ var = my sql fetch array)

 

the question i have is that when i print_r($var)

 

i get the associative array of all elements from what i selected. i need to print a certain column, $row['columnName'] as links that link to a php page named myPHP.php

 

i no i need to use echo "a href = "......"

 

but i just cant get this to work

 

can someone post some example code that i can use to link my links

 

regards

Link to comment
https://forums.phpfreaks.com/topic/180960-printing-links/
Share on other sites

Ok without giving me an answer in code plse :D

 

if i have printed my link of all the items in the database, but with my link i want to pass to another form another columnName variable from the same table how would i pass it?

 

hope that makes sence?

 

i would post code but would rather not get in trouble for cheating <hence the "without giving me an answer in code" > part :D

Link to comment
https://forums.phpfreaks.com/topic/180960-printing-links/#findComment-954750
Share on other sites

Do you mean to pass another column value through the URL like myPHP.php?something=column_name ?

 

i will just post my code and delete it, that should be fine

 

$result = mysql_query("select * from country"); // load details from country table

while($row = mysql_fetch_array($result)){

echo "<a href='theCountry.php'>{$row['name']}</a>" . "<br/>";

//$id = $_POST[$row['id']];

//echo $id;

}

 

as far as i know i can pass a value with the links i am printing above so that it can be captured on a new page

 

the value i went to send is from the same table, but it would this time be row[id] instead of row[name]

 

is it possible to send this information, as is it the correct thing for me to do as at the other end when i determine what he country is (via its id ) i can print some bespoke things about it from another part of the database

Link to comment
https://forums.phpfreaks.com/topic/180960-printing-links/#findComment-954759
Share on other sites

Not giving the clearest explanation of what you're trying to do. Where exactly does the "value" you wish to pass come from? As I asked before do you mean you wish to pass that value through the URL parameters so you can capture it at the link destination?

Link to comment
https://forums.phpfreaks.com/topic/180960-printing-links/#findComment-954836
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.