how can i transfer one query variable to another page

hello...i have a qurey variable $query = "select * from..&qu

Page 1 of 1

3 Replies - 1597 Views - Last Post: 05 June 2008 - 10:13 AM Rate Topic: -----

#1 sheenrose  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 03-June 08

how can i transfer one query variable to another page

Post icon  Posted 04 June 2008 - 12:12 AM

hello...i have a qurey variable $query = "select * from..";its a long query and i want to get it into another page without using session .can any one help me out??
Is This A Good Question/Topic? 0
  • +

Replies To: how can i transfer one query variable to another page

#2 JBrace1990  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 110
  • View blog
  • Posts: 760
  • Joined: 09-March 08

Re: how can i transfer one query variable to another page

Posted 04 June 2008 - 05:55 AM

at the beginning of the page, you need to have:

session_start();

to set a session, you use the following:

$_SESSION['name'] = $query;

replace "name" with the name of the session.
Was This Post Helpful? 0
  • +
  • -

#3 joeyadms  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 41
  • View blog
  • Posts: 178
  • Joined: 04-May 08

Re: how can i transfer one query variable to another page

Posted 04 June 2008 - 07:21 AM

If your coding redundantly, like use the same query in a lot of pages, you should just code the query into your database abstraction layer. Wrap it with a function, then you can call it whenever you need to.
Was This Post Helpful? 0
  • +
  • -

#4 silverblaze  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 69
  • Joined: 18-January 08

Re: how can i transfer one query variable to another page

Posted 05 June 2008 - 10:13 AM

hi,

y exactly do u need to sent the entire query into another page. u can always sent the values and create a query their rite?. or as joeyadms said just keep the main query in a function and call the function with suitable arugments. and its safe to sent arguments thru sessions or evn cookies or db.

hope this will help.. if u can tell ur needs more clearly then i might be able to help u more.

tak care..
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1