dynamic url from MySql field data

From: Date: Fri, 16 Mar 2001 20:58:13 +0000
Subject: dynamic url from MySql field data
Groups: php.general 
Request: Send a blank email to php-general+get-44318@lists.php.net to get a copy of this message
I am attempting to create a dynamic url from a field that has the value of the dynamic url. Here is the scenario: 1 - Field in MySql database = $logo_link_var = page.php3?afl=$afl&site=$site&page=contact&ad=$ad_type 2 - Select logo_link_var from database and assign to $logo_link -- code is: $search_query = "select site.logo_link_var from site where ( $afl = site.afl_name )"; $result = mysql_query ( $search_query ); $logo_link = mysql_result ( $result, 0, "site.logo_link_var" ); (only 1 record matches query) $logo = "<a href='$logo_link'><img src='../allimages/$logo_graphic' width='$logo_link_width' height='$logo_link_height' border='0' alt='$logo_alt_text'></a>"; When I click on the link I receive parse errors -- and the window displays this section in the url: page.php3?afl=$afl&site=$site&page=contact&ad=$ad_type The program is not finding the $afl or $site values if I create the $logo variable as follows -- it works OK. $logo = "<a href='page.php3?afl=$afl&site=$site&page=contact&ad=$ad_type'><img src='../allimages/$logo_graphic' width='$logo_link_width' height='$logo_link_height' border='0' alt='$logo_alt_text'></a>"; Any suggestions?

« previous php.general (#44318) next »