Results 1 to 2 of 2

Thread: a href filling info from mysql

  1. #1
    Join Date
    Jul 2007
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default a href filling info from mysql

    where am i going wrong in my syntax here? while the link appears to work, none of the imagery called from the database does. help appreciated

    $fetch = mysql_query("SELECT * FROM fragrances WHERE ID=$ID LIMIT $startrow, 6")or
    die(mysql_error());

    $ima_link=$row['ima_link'];
    $sku=$row['sku'];
    $title=$row['title'];

    echo "<table class='main_table'>";
    while($row = mysql_fetch_array( $fetch )) {
    // Print out the contents of each row into a table
    echo "<tr><td class='image_td' rowspan='2' valign='top'>";
    echo '<a href="'.$_SERVER['PHP_SELF'].'?sku='.$sku.'"><img alt="'.$title.'" src="'.$_SERVER['PHP_SELF'].'/images/'.$ima_link.'" /></a>';
    echo "</td><td class='title_td' valign='top'>";
    echo $row['title'];
    echo "</td><td class='type_td' rowspan='2' valign='top'>";
    echo $row ['size']. " ". $row['type'];
    echo "<p class='rrp'>RRP &#163;";
    echo $row['rrp'];
    echo "</p><p class='&#163;'>DFUK &#163;";
    echo $row['&#163;'];
    echo "</p><p class='store'>";
    echo $row['SHO'];
    echo "</p><p class='buttons'>";
    echo $row ['cli_link']. $row['buy_link'];
    echo "</p></td></tr><tr><td class='manufacturer_td' valign='top'>";
    echo $row['manufacturer'];
    echo "</td></tr><tr><td class='hr_td' colspan='3' valign='top'>&nbsp;";
    echo "</td></tr>";
    }

    echo "</table>";

  2. #2
    Join Date
    May 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Surely these three lines:
    PHP Code:
    $ima_link=$row['ima_link'];
    $sku=$row['sku'];
    $title=$row['title']; 
    Should come after:
    PHP Code:
    while($row mysql_fetch_array$fetch )) { 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •