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
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.
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
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'";
?>