logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > General
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 08-20-2007, 09:54 AM   #1
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,162
Default code challenged

what am i doing wrong here!!
I am trying to make a link to a detail page so if i were to write
Code:
echo      " <a href= \"job_details.php?recordID=64 
        \"> Details </a>";
that works except every record would pass the value 64
if I echo
Code:
echo     $row["id"];
the correct id is shown but i cant manage to code correctly. I thought it was
Code:
echo      " <a href= \"job_details.php?recordID=\"$row["id"]\" 
        \"> Details </a>";
but I am clearly being dense. how should i return the id?
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 08-20-2007, 10:16 AM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

try this...

PHP Code:
echo      " <a href= \"job_details.php?recordID=$row['id']\"> Details </a>"
remember that $row['id'] is an array so will need to be inside a do while loop for it to return a relevant ID for a line of db data or it would only return the first db row
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 08-21-2007, 09:35 AM   #3
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,162
Default

got it thanks david. it is in a while loop. I declared $row['id']as a variable and then it worked yet it wouldnt work as above ???
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:42 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com