Jump to content

Not grabbing userId for link/url


Megachunk

Recommended Posts

Hello.

 

I have this code that is creating tables and columns and making the links, but its not grabbing the userId to take it to the next page. Please see attached page:

 
Am I trying to make the links grab the associated userId to take it to the page of that Id. Any help is greatly appreciated. Thanks in advance.
 
Mike

 

artists.php

Link to comment
https://forums.phpfreaks.com/topic/296243-not-grabbing-userid-for-linkurl/
Share on other sites

Being a newbie, I'm not sure how to implement it in my existing code. I tried inserting it into where the span class .artist is, but it doesn't seem to work for me. How could I associate it with what I have? thanks in advance: I really appreciate the help!

 

<?php
 
  $currentColumn=0;
 
  echo "<tr>".PHP_EOL;
 
  while($artist = mysql_fetch_assoc($rs_artistNames))
  {
    $currentColumn = $currentColumn +1;
 
    echo " <td align='left'><B><a href='artists_details.php?userId='<span class=.artist'>".$artist['artistName']." ".$artist['lastName']."</B></a> <BR> ".$artist['bandName']."</span></td>".PHP_EOL;
 
    //the modulo function (%) returns 0 if evenly divisible
    if($currentColumn % 4 == 0)
    {
      echo "</tr>".PHP_EOL;
      echo "<tr>".PHP_EOL;
    }  
 
  }
 
  echo "</tr>".PHP_EOL;
?>

Currently your link is invalid html. If you look at my post you will see I posted the correct syntax for your link. The artists span goes where the ... is in my code.

 

Also when adding the name of a class to a html tag you don't include the period in the class name.

Thanks very much! This should help.

 

Still having a bit of trouble getting it to work, but I should be able to figure it out with what I've got. The page makes the links now but doesn't connect to the userId. I really appreciate the help! Thanks so much!

 

Mike

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.