SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up i want to pass the make id value in hyperlink. but i counldn't please help me!

    hi all,

    i want to pass the makeid value in hyperlink. but that value not displayed but name is displayed . so please help me!

    PHP Code:
     <td colspan="2"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                          <?php 
    $row
    =2;
    $result=array();
    $alp=array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
    for(
    $i=0;$i<count($alp);$i++)
    {
     
    $qry="select * from bike_make where makename like '".$alp[$i]."%' limit 0,$row";
     
    $res=mysql_query($qry) or die(mysql_error());
     while(
    $info=mysql_fetch_array($res))
    {
    $id=$info['makeid'];
      
    $name[]=$info['makename'];
        
    //$a=$a.",".$id;
    }
    echo 
    $a;

    ?>
    <table >
    <tr>
    <?php 
    for($i=0$i<=count($name); $i++)
    {
    ?>
    <td class="LinkTohama11NBlueRed" height=20 width="500"><a href="makes.php?makeid=<?=$info['makeid']?>&name=<?=$name[$i];?>" class="LinkTohama11NBlueRed">
    <?php echo $name[$i?></a>
    <?php if($i%5==0)
            { 
    ?>
    </td>
                </tr>
                <tr>
       <?php 
    }
    ?>
    </tr></table>
    Last edited by sweatje; Aug 4, 2006 at 05:18. Reason: use PHP tags

  2. #2
    SitePoint Guru MikeBigg's Avatar
    Join Date
    Jun 2004
    Location
    Reading, UK
    Posts
    970
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you get if you echo $id after this line:

    $id=$info['makeid'];

    Mike


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
  •