Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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