missing value when passing through links.

They have: 164 posts

Joined: Nov 2001

i passed these value from a link to page A

<?php
admin
.php?action=addRe&category_ID=$id
?>

and then from page A i passed these values to page B.

<?php
<a href=\\"admin.php?action=writeRe&cat_ID=$category_ID\\"><b>Write a review</b></a>
?>

i did put hidden field but i can't get the cat_ID in page B. in the url, the cat_ID do have value but when i have this sql query:

<?php
$sql
= \"SELECT * FROM cat_review WHERE cat_ID = '$cat_ID'\";
       
$result = mysql_query($sql);

       
$record = mysql_fetch_array($result);
?>

cat_ID don't have any value. wat is wrong? pls help..

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

The only thing that I see, is that the link in page A is missing the value for the category. I'm guessing that this is a typo?

<?php
$sql
= \"SELECT * FROM cat_review WHERE cat_ID = '$cat_ID'\";
$result = mysql_query($sql);
if (!
$result) {
    echo \"\n<!--QUERY ERROR:\" . mysql_error() . \"-->\n\";
    echo \"<!--QUERY:
$sql-->\n\";
}
$record = mysql_fetch_array($result);
?>
Does this print anything useful?

Mark Hensler
If there is no answer on Google, then there is no question.

They have: 164 posts

Joined: Nov 2001

oops..i forgot to declare the variable inside my function. that is why not working.

thanks..mark... Smiling)

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.