Need Some Help

Discussion in 'PHP' started by johny321, Jun 4, 2010.

  1. #1
    I want to assign a array value to a variable while i am fetching value from a database with loop. You can say displaying values from a table & want to assign that coming values into a variable then want to show that variable separately but have some problem. Can any body share with me his experience
     
    johny321, Jun 4, 2010 IP
  2. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #2
    What problem you had??
    I didn't faced any i used an variable say $i and it counts and used $variable[$i]
    And printed that! :)
     
    roopajyothi, Jun 4, 2010 IP
  3. johny321

    johny321 Member

    Messages:
    293
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    acutally i am gettting this from table


    while ($getrow = mysql_fetch_assoc($get))
    {

    if($getrow['code']==$search) {echo $getrow['code']; echo (" </br>");
    echo $getrow['name']; echo (" </br>"); echo $getrow['URL'];

    Three varaible which show output just like this





    001 Job www.jobs.com

    Now i want to make job hyperlink with show URL www.jobs.com. There are approximately many records in my database. Now i desire to get output

    just like this ( want to make job hyperlink with inserted URL againist 001 in table)


    001 Job www.jobs.com
     
    johny321, Jun 4, 2010 IP
  4. lukeg32

    lukeg32 Peon

    Messages:
    645
    Likes Received:
    19
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Looking at your code above, you will need something like,

    while ($getrow = mysql_fetch_assoc($get))
    {
    
    if($getrow['code']==$search) {
    	echo $getrow['code']; echo (" </br>");
    	echo '<a href="'.$getrow['URL']'" title="'.$getrow['name'].'">'.$getrow['name'].'</a>'; 
    	echo (" </br>"); echo $getrow['URL'];
    	}
    }
    PHP:
     
    lukeg32, Jun 4, 2010 IP
  5. johny321

    johny321 Member

    Messages:
    293
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #5
    Thanks dear for help
     
    johny321, Jun 5, 2010 IP