This topic is locked

URL Redirect

2/22/2008 8:03:30 AM
PHPRunner General questions
L
Lisa2006 author

MASTER TABLE: ebay_posting

FIELDS: name, address, order_number, ID
DETAIL TABLE: postings

FIELDS: name, address, order_number, ID
On ebay_posting | List Page: Before display Event, i've inserted the following code snippet
global $conn;

$str = "select * from postings where id='".$_SESSION["id"]."'";

$rs = db_query($str,$conn);

$data = db_fetch_array($rs);
);

exit();
When executed, i click the link on postings_list.php and get redirected to ebay_posting_edit.php?editid1=
Cannot understand why it is not picking up the relevant id.
Your help & support would be much appreciated.
Lisa

S
spintz 2/22/2008

do a print_r( $data ); and make sure ID is in there.

J
Jane 2/22/2008

Hi,
it seems that $_SESSION["id"] isn't filled.

Check your code where you fill this variable.

L
Lisa2006 author 2/22/2008

I'm not sure if i have explained the scenerio properly.
Here Goes:

TABLE: ebay_posting

FIELDS: name, address, order_number, ID

(Primary key = ID)
TABLE: postings

FIELDS: name, address, order_number, ID

(Primary Key = order_number)
Master-Detail Relationship:

ebay_posting: Table = posting, Primary = order_number, Foreign = order_number
At the posting_list.php page i can see all records in the posting table. These records are set as links due to the 'master-detail relationship' setup.
When i click on the 1st record link on posting_list.php (say with id=285), i want to be redirected to the ebay_posting_edit.php?editid1=285.
Question:

What event should i be placing the code in?

What code should i be using to achieve this?
Thank you in advance
Lisa <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=26225&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />

T
turbodelphi 2/23/2008

Hey Lisa,
Don't forget, PHP is case sensitive so :

$_SESSION["id"] is not equivalent to $_SESSION["ID"]
Have a nice day.