Advertisement

05.09.2008 at 04:53AM PDT, ID: 23388970
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

php coding problem

Tags: adobe, dreamweaver, cs3
can any one tell me why this is not working.

Im learning php in dreamweaver, I creat 3 links the third one is not working even when everything is the same.

anyone know how to creat a navigation bar with submenu connected to the database in Dreamweaver?

Im including the php file and the table information in the code seccion. Thanks for the help
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
<?php require_once('../Connections/OnePageWebsite.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
mysql_select_db($database_OnePageWebsite, $OnePageWebsite);
$query_rsKeyNav1 = "SELECT `key` FROM frutas ORDER BY `key` ASC";
$rsKeyNav1 = mysql_query($query_rsKeyNav1, $OnePageWebsite) or die(mysql_error());
$row_rsKeyNav1 = mysql_fetch_assoc($rsKeyNav1);
$totalRows_rsKeyNav1 = mysql_num_rows($rsKeyNav1);
 
mysql_select_db($database_OnePageWebsite, $OnePageWebsite);
$query_rsKeyNav2 = "SELECT `key` FROM fruta2 ORDER BY `key` ASC";
$rsKeyNav2 = mysql_query($query_rsKeyNav2, $OnePageWebsite) or die(mysql_error());
$row_rsKeyNav2 = mysql_fetch_assoc($rsKeyNav2);
$totalRows_rsKeyNav2 = mysql_num_rows($rsKeyNav2);
 
mysql_select_db($database_OnePageWebsite, $OnePageWebsite);
$query_rsCarrosNav = "SELECT `Key` FROM carros ORDER BY `Key` ASC";
$rsCarrosNav = mysql_query($query_rsCarrosNav, $OnePageWebsite) or die(mysql_error());
$row_rsCarrosNav = mysql_fetch_assoc($rsCarrosNav);
$totalRows_rsCarrosNav = mysql_num_rows($rsCarrosNav);
 
$colname_rsVariCont1 = "-1";
if (isset($_GET['pagkey'])) {
  $colname_rsVariCont1 = $_GET['pagkey'];
}
mysql_select_db($database_OnePageWebsite, $OnePageWebsite);
$query_rsVariCont1 = sprintf("SELECT variables FROM frutas WHERE `key` = %s", GetSQLValueString($colname_rsVariCont1, "text"));
$rsVariCont1 = mysql_query($query_rsVariCont1, $OnePageWebsite) or die(mysql_error());
$row_rsVariCont1 = mysql_fetch_assoc($rsVariCont1);
$totalRows_rsVariCont1 = mysql_num_rows($rsVariCont1);
 
$colname_rsVariCont2 = "-1";
if (isset($_GET['pagkey'])) {
  $colname_rsVariCont2 = $_GET['pagkey'];
}
mysql_select_db($database_OnePageWebsite, $OnePageWebsite);
$query_rsVariCont2 = sprintf("SELECT variables FROM fruta2 WHERE `key` = %s", GetSQLValueString($colname_rsVariCont2, "text"));
$rsVariCont2 = mysql_query($query_rsVariCont2, $OnePageWebsite) or die(mysql_error());
$row_rsVariCont2 = mysql_fetch_assoc($rsVariCont2);
$totalRows_rsVariCont2 = mysql_num_rows($rsVariCont2);
 
$colname_rsCarros = "-1";
if (isset($_GET['pagKey'])) {
  $colname_rsCarros = $_GET['pagKey'];
}
mysql_select_db($database_OnePageWebsite, $OnePageWebsite);
$query_rsCarros = sprintf("SELECT variables FROM carros WHERE `Key` = %s", GetSQLValueString($colname_rsCarros, "text"));
$rsCarros = mysql_query($query_rsCarros, $OnePageWebsite) or die(mysql_error());
$row_rsCarros = mysql_fetch_assoc($rsCarros);
$totalRows_rsCarros = mysql_num_rows($rsCarros);
?>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
 
<body>
<p><a href="Untitled-4.php?pagkey=<?php echo $row_rsKeyNav1['key']; ?>">Key1</a></p>
<p><a href="Untitled-4.php?pagkey=<?php echo $row_rsKeyNav2['key']; ?>">Key2</a> </p>
<p><a href="Untitled-4.php?pagkey=<?php echo $row_rsCarrosNav['Key']; ?>">Carros</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<?php echo $row_rsVariCont1['variables']; ?><?php echo $row_rsVariCont2['variables']; ?><?php echo $row_rsCarros['variables']; ?>
</body>
</html>
<?php
mysql_free_result($rsKeyNav1);
 
mysql_free_result($rsKeyNav2);
 
mysql_free_result($rsCarrosNav);
 
mysql_free_result($rsVariCont1);
 
mysql_free_result($rsVariCont2);
 
mysql_free_result($rsCarros);
?>
 
 
____________________________________________________________
Here is the Table information:
 
-- phpMyAdmin SQL Dump
-- version 2.10.2
-- http://www.phpmyadmin.net
-- 
-- Host: localhost
-- Generation Time: May 09, 2008 at 07:49 AM
-- Server version: 5.0.41
-- PHP Version: 5.2.5
 
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
 
-- 
-- Database: `onepage_website`
-- 
 
-- --------------------------------------------------------
 
-- 
-- Table structure for table `carros`
-- 
 
CREATE TABLE `carros` (
  `Key` varchar(50) NOT NULL,
  `variables` varchar(100) NOT NULL,
  PRIMARY KEY  (`Key`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- 
-- Dumping data for table `carros`
-- 
 
INSERT INTO `carros` VALUES ('carro1', 'Ford');
INSERT INTO `carros` VALUES ('carro2', 'Cadilac');
INSERT INTO `carros` VALUES ('carro3', 'Chevrolet');
INSERT INTO `carros` VALUES ('carro4', 'Toyota');
 
-- --------------------------------------------------------
 
-- 
-- Table structure for table `fruta2`
-- 
 
CREATE TABLE `fruta2` (
  `key` varchar(50) NOT NULL,
  `variables` varchar(100) NOT NULL,
  PRIMARY KEY  (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- 
-- Dumping data for table `fruta2`
-- 
 
INSERT INTO `fruta2` VALUES ('key1', 'ROJO');
INSERT INTO `fruta2` VALUES ('key2', 'AMARILLO');
INSERT INTO `fruta2` VALUES ('key3', 'NARANJA');
INSERT INTO `fruta2` VALUES ('key4', 'VILETA');
 
-- --------------------------------------------------------
 
-- 
-- Table structure for table `frutas`
-- 
 
CREATE TABLE `frutas` (
  `key` varchar(50) NOT NULL,
  `variables` varchar(100) NOT NULL,
  PRIMARY KEY  (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
-- 
-- Dumping data for table `frutas`
-- 
 
INSERT INTO `frutas` VALUES ('manzana', 'roja');
INSERT INTO `frutas` VALUES ('guineo', 'amarillo');
INSERT INTO `frutas` VALUES ('china', 'anaranjada');
INSERT INTO `frutas` VALUES ('Uvas', 'violetas');
Start your free trial to view this solution
Question Stats
Zone: Software
Question Asked By: saul_roldan
Solution Provided By: cyberwebservice
Participating Experts: 2
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
05.09.2008 at 04:57AM PDT, ID: 21531866

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 05:47AM PDT, ID: 21532180

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 06:50AM PDT, ID: 21532749

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 07:20AM PDT, ID: 21533084

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 08:16AM PDT, ID: 21533705

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 08:23AM PDT, ID: 21533796

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 08:31AM PDT, ID: 21533902

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 08:37AM PDT, ID: 21533959

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 09:12AM PDT, ID: 21534296

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
05.09.2008 at 04:57AM PDT, ID: 21531866

Rank: Master

try using smaller case for 'key' in the third link.

$row_rsCarrosNav['Key']
==>

$row_rsCarrosNav['key']
Accepted Solution
 
05.09.2008 at 05:47AM PDT, ID: 21532180

Rank: Master

oops...the field name is in the proper case only.

What exactly happens when you click the third link?
 
05.09.2008 at 06:50AM PDT, ID: 21532749
what about the second part of my question.  Do you know how to creat a navigation bar with sub menu in dreamweaver connected to the database. you can use the table that i send
 
05.09.2008 at 07:20AM PDT, ID: 21533084
some logging (using echo for example) may help you solve the problem
echo the values several times while working
for example:
1- the row returned from the query;
2- the value u put in the href
and so on..

also tell us how the link looks like (right click-> copy link location)
 
05.09.2008 at 08:16AM PDT, ID: 21533705
I want a simple way to do a navigation bar-drop down menu in dreamweaber using php to connect to my database.

something like this

Head1             head2             head3
  subhead1      subhead1       subhead1
  subhead2      subhead2        subhead2
 
05.09.2008 at 08:23AM PDT, ID: 21533796

Rank: Master

Try this script. It is easy to change. Just follow the steps.

http://www.dynamicdrive.com/dynamicindex1/chrome/index.htm
 
05.09.2008 at 08:31AM PDT, ID: 21533902
thank, something like this, but how I connect the link using php to the database in dreamweaver.
 
05.09.2008 at 08:37AM PDT, ID: 21533959

Rank: Master

you can use php variable in the menu.

you cannot do this with dreamweaver alone. you should change the code manually. just copy those js files and css files in the right folders and link it to your php page.

Connect to the database in php and display the data in the menu.
Let me know where you face the problem.
 
05.09.2008 at 09:12AM PDT, ID: 21534296
forguive me my English is not that great. the menu is the style I want but Im looking to creat it dynamically using the data table information. all the information of the menu will be on a table.
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628