Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Multi-Dimensional Array Query

$
0
0
Hi,

I am trying to complete a multi-dimensional array however when I use the following link:

website.php?skill=print-design

It echoes the following:

skills.php?skill=


The plan is to query skill1, skill2 and skill3 by querying skill only. Does anyone have any suggestions on how I can clear it.
		<?php
if (isset($_GET['skills']))
$skills = array('skill1' => 'skill value 1', 'skill2' => 'skill value 2', 'skill3' => 'skill value 3');
echo "skills.php?skill=" . base64_encode($skills);
$skillsEncoded = $_GET['skill'];
$skills = base64_decode($skillsEncoded);
$sql = "SELECT * FROM users WHERE skill1 = '$skills'";
$res = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($res); 
$num_rows = mysql_num_rows($res); 
?>


<?php echo ($row['skill1']); ?>

Viewing all articles
Browse latest Browse all 13200

Trending Articles