Link Reading 3 Different Rows?

Hi,

I have been trying to complete a multi-dimensional array. The idea is that someone can click on 1 of 3 skills. I have tried to insert the skills and User ID into its own table. However I still cant create a link which reads all 3 skills.

Does anyone have any suggestions as to how I can create a link which reads 3 different rows?

Skill1: Web Design User ID: 17
Skill2: Graphic Design User ID: 17
Skill3: SEO Marketing User ID: 17

eventskillsquery.php?skill= Reads skill1 / skill2 or skill3

http://myDomain.com/links.php?id=17&sk1=Web+Design&sk2=Graphic+Design&sk3=SEO+Marketing

Thanks,

But I am confused how this would work.

I want to echo the three skills seperately.

Or could I still do this…


http://myDomain.com/links.php?id=17&sk1=Web+Design&sk2=Graphic+Design&sk3=SEO+Marketing >Web Design</a>

http://myDomain.com/links.php?id=17&sk1=Web+Design&sk2=Graphic+Design&sk3=SEO+Marketing >Graphic Design</a>

To do them separately you might use

<a http://myDomain.com/links.php?id=17&sk=Web+Design>Web Design</a>
<a http://myDomain.com/links.php?id=17&sk=Graphic+Design>Graphic Design</a>
<a http://myDomain.com/links.php?id=17&sk=SEO+Marketing>SEO+Marketing</a>

Note that there are now only two arguments id and sk instead of four id, sk1, sk2, sk3.

Thanks,

That it what I am trying to do.

But how do I make ‘sk’ read Skill1,Skill2 and Skill3?

That’s an entirely different question and the answer depends on how your data is organized. Is it in a file? Is it in a database? How is it mapped to memory (variables)? You need to start from the structure of the data.

Hi,

Its just in a table like this:

Skill1: Web Design User ID: 17
Skill2: Graphic Design User ID: 17
Skill3: SEO Marketing User ID: 17
Skill1: Catering User ID: 18
Skill2: Food Production User ID: 18
Skill3: Qualified Chefs User ID: 18

There is also another row with the hyphen in.

I’m still not clear on the organization of the data. If the user has a record with

id, skill1, skill2, skill3

to access the right record and the right column you would use something like

$sql = "SELECT id, '$skill' AS skill
          FROM table
         WHERE ID = '$id'";

The link has to return the two data ‘$skill’ and ‘$id’. The links would be:

<a http://myDomain.com/links.php?id=17&sk=skill1>Skill 1 or some other text</a>
<a http://myDomain.com/links.php?id=17&sk=skill2>Skill 2</a>
<a http://myDomain.com/links.php?id=17&sk=skill3>Skill 3</a>

The php to do the transformation:

<?php
$skill = $_GET['sk'];
$id = $_GET['id'];
$sql = "SELECT '$skill' AS skill
          FROM table
         WHERE id = '$id'";
?>

There is also another row with the hyphen in.

I don’t understand what this means.

Hi,

This is what I have so far so I insert the skill 1 with hyphens as the link and then echo the skill without the hyphens to appear on the screen.

<a href="/siteinfo/eventskillsquery.php?skill=<?php echo $row['skill1link'] ; ?>"  class='dealpagelink' >
<?php echo $row['skill1'] ; ?>
	
<div class="content">
<div class="eventskillsbox">
                <?php
$query = mysql_query("SELECT skill1, skill2, skill3, skill1link, skill2link, skill3link
FROM users ");
while($row = mysql_fetch_array($query)) {
?>
<?php if (!empty($row['skill1'])) : ?>
<div class="eventskillscell">
<a href="/siteinfo/eventskillsquery.php?skill=<?php echo $row['skill1link'] ; ?>"  class='dealpagelink' >
<?php echo $row['skill1'] ; ?>
</a>
</div>
<?php endif; ?>
<?php if (!empty($row['skill2'])) : ?>
<div class="eventskillscell">
<a href="/siteinfo/eventskillsquery.php?skill=<?php echo $row['skill2link'] ; ?>"  class='dealpagelink' >
<?php echo $row['skill2'] ; ?>
</a>
</div>
<?php endif; ?>
<?php if (!empty($row['skill3'])) : ?>
<div class="eventskillscell">
<a href="/siteinfo/eventskillsquery.php?skill=<?php echo $row['skill3link'] ; ?>"  class='dealpagelink' >
<?php echo $row['skill3'] ; ?>
</a>
</div>
<?php endif; ?>

<?php
}
?>