Page 1 of 1

passing variable though pages...?

Posted: Sat Nov 05, 2005 3:18 am
by rami
feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


i have query as(in pagination page) code

Code: Select all

$query = "SELECT reserved.book_id,students.name,books.bookname,reserved.date,students.program,reserved.reserved_id  FROM reserved,books,students where reserved.book_id=books.book_id and reserved.library=students.library ORDER BY date"; 
		$query_result = mysql_query ($query);
.......................................
..............................
	}
			
			echo '</p><br />';
			
		} // End of links section.
		
		// Table header.
		echo '<table align="left" cellspacing="2" cellpadding="2">
		<tr><td align="left"><b>Reserved Book</b></td><td align="left"><b>Reserved By</b></td><td align="left"><b>Book Name</b></td><td align="left"><b>Reserved Date</b></td>
<td align="left"><b>Program</b></td><td align="left"><b>Delete(click on num)</b></td>
</tr>';
		
		// Fetch and print all the records.
		$bg = '#eeeeee'; // Set the background color.
		while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
   			$bg = ($bg=='#eeeeee' ? 'cyan' : '#eeeeee'); // Switch the background color.
			echo '<tr bgcolor="', $bg, '"><td align="left">', stripslashes($row[0]), '</td><td align="left">', $row[1], '</td><td align="left">', stripslashes($row[2]), '</td><td align="left">', $row[3], '</td><td align="left">', stripslashes($row[4]), '</td>
<a href="delreserve.php?uid=($row[0])"><td align="left">', stripslashes($row[5]), '</td></a></tr>
';
		}
	
		echo '</table>';
the problem is this part

Code: Select all

stripslashes($row[4]), '</td>
<a href="delreserve.php?uid=($row[0])"><td align="left">', stripslashes($row[5]), '</td></a></tr>
i want to pass bookid to delreserve page
but it doesnot pass bookid
what is correct syntax for it
please help
thanks


feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Sat Nov 05, 2005 4:54 am
by patrikG
one way to do it would be sessions (see http://php.net/manual/en/ref.session.php), another using a hidden form-value or passing it via the URL (if your form doesn't use $_GET)

Posted: Sat Nov 05, 2005 6:19 pm
by rami
patrikG wrote:one way to do it would be sessions (see http://php.net/manual/en/ref.session.php), another using a hidden form-value or passing it via the URL (if your form doesn't use $_GET)
thanks
r u the same mr pratik that write mods in phpbb.com
any way could not be quick edit done in that one line
i think that would solve problem for now
any way thanks

Posted: Sun Nov 06, 2005 8:45 am
by patrikG
rami wrote:r u the same mr pratik that write mods in phpbb.com
nope, that'd be a different Mr Patrik.