On line 38 you'll need something like this, assuming user_type is an integer column in your table:
$row = mysql_fetch_assoc($result);
switch ($row['user_type'])
{
case 1: header(); break;
case 2: header(); break;
// etcetera
}
pritaeas
Posting Prodigy
9,311 posts since Jul 2006
Reputation Points: 1,178
Solved Threads: 1,465
Skill Endorsements: 86
You can use parse_url() to get the 'bits' and use the 'path' item. Just search in that.
Explode on '/' to isolate the city, region etc.
Then explode on ',' to get the 'key' and 'value'
diafol
Keep Smiling
10,668 posts since Oct 2006
Reputation Points: 1,632
Solved Threads: 1,514
Skill Endorsements: 57
if(isset($_GET['category'])){
$cat = $_GET['category'];
if(isset($myarray[$cat])){
echo $myarray[$cat];
}else{
echo "Not found in array";
}
}
diafol
Keep Smiling
10,668 posts since Oct 2006
Reputation Points: 1,632
Solved Threads: 1,514
Skill Endorsements: 57
It doesn't look anything wrong in your code and it also works fine in my webform. It's hard to figure out the issue.
annaharris
Junior Poster in Training
67 posts since Apr 2013
Reputation Points: 0
Solved Threads: 6
Skill Endorsements: 0
It's good that you have resolved your issue. Congrats.
annaharris
Junior Poster in Training
67 posts since Apr 2013
Reputation Points: 0
Solved Threads: 6
Skill Endorsements: 0
If it already exists in your table, that means the record has been duplicated. First remove the duplicacy issue.
annaharris
Junior Poster in Training
67 posts since Apr 2013
Reputation Points: 0
Solved Threads: 6
Skill Endorsements: 0
Huh? There is no such animal(s) in SQL. What exactly are you trying to do? Give an example of your schema and the data it contains, and what you want to do for correlating that data to "category/sub-category".
rubberman
Posting Maven
2,581 posts since Mar 2010
Reputation Points: 365
Solved Threads: 307
Skill Endorsements: 52