Jump to content

Tony808

New Members
  • Posts

    2
  • Joined

  • Last visited

Tony808's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you. Maybe I was not clear. I want to replace the URL that is created by this statement: $link[] = 'index.php?id='.$row['fld_main_link_id'].'&ss='.$row['fld_ss'].'&'.$row['fld_link'];//$row['fld_link'] with another web address, for example somesite.com I thought that this would work: if catArray[] = 4 $link[] = 'http://somesite.com'; but I end up with this error: Parse error: syntax error, unexpected T_STRING, expecting '(' in /home/moc/public_html/nav.php on line 26 Line 26 is the line I added. Here is the code I am working with, with my line added at the end: sql = "SELECT * FROM tbl_main_links ORDER BY fld_main_link_id"; #### Query 1 MAIN LINKS #### $sql = "SELECT * FROM tbl_main_links ml WHERE ml.fld_status ='1' ORDER BY ml.fld_sort "; $result = mysql_query($sql, $db_connection) or die(mysql_error()); $catArray = array(); $name = array(); ## fetch an array ## while ($row = mysql_fetch_assoc($result)): ## build the arrays for looping through sub links ## $catArray[] = $row['fld_main_link_id']; $text[] = $row['fld_text']; $ssL[] = $row['fld_ss']; $link[] = 'index.php?id='.$row['fld_main_link_id'].'&ss='.$row['fld_ss'].'&'.$row['fld_link'];//$row['fld_link'] if catArray[] = 4 $link[] = 'http://somesite.com'; Thanks in advance for any assistance!
  2. I have a SQL query that I want to qualify the output of: ## build the arrays for looping through sub links ## $catArray[] = $row['fld_main_link_id']; $text[] = $row['fld_text']; $ssL[] = $row['fld_ss']; $link[] = 'index.php?id='.$row['fld_main_link_id'].'&ss='.$row['fld_ss'].'&'.$row['fld_link'];//$row['fld_link'] I want to re-write the URL based on the $catArray for example, if catArray[] = 5 redirect to http://somesite.com Is this possible? And if so, help? Thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.