How to create links which pass arguments to a page? I am making a website which displays table from a database. For every row of the table I want to provide a link(or button) which will be placed in the last column and will redirect to a page displaying records from another table associated with that row. Is there a way to create such link which would pass an argument (row id) to another page so it could display apropriate records?
Thanks
You can use l() function, Like
Suppose You are showing some data in table format as you mention in your question and using some query you get some data from databse in $result variable,

$header = array(t('Approved By'), t('Role'), t('Points'), t('View
More'));
foreach ($result as $row) {
    $rows[] = array($row['user_name'], $row['user_role'], $row['date'], l(t('View'), 'node/' . $row['row_id']));
}
return theme('table', array('header' =&gt; $header, 'rows' =&gt; $rows));

Now above code create a page showing table

Approved By    Role                    Points    View More
Eve            content writer          94        View    -> url: my-page/1

John           content manager         80        View    -> url: my-page/2

Adam           manager                 67        View    -> url: my-page/3
  
Jill           admin                   50        View    -> url: my-page/4



function my_module_menu() {
    $item['my-page/%'] = array(
        'title' =&gt; 'my page',
        'page_callback' =&gt; array()
        'page callback' =&gt; 'my_page_callback',
        'page arguments' =&gt; array(1),
        'access arguments' =&gt; array('access content overview')
    );
return $item; }
function my_page_callback($row_id) {
    // Get some data from database using $row_id
    // show in table
}