[urgen] sessiong problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • drinker

    [urgen] sessiong problem

    Dear All,


    how to put connect object to session variable like that:

    start_session() ;
    $_SESSION['conn']=mysql_connect( 'localhost',$ui d,$pass);
    mysql_select_db ('account',$_SE SSION['conn']);


    the $_SESSION['conn'] variable cannot use in "main.php" my html:

    <form action='main.ph p' method='post'>
    <input type=submit>
    </form>

    how to pass $_SESSION['conn'] object to other script after submit action?
    thank you
  • Geoff Berrow

    #2
    Re: [urgen] sessiong problem

    I noticed that Message-ID:
    <666497d7.04031 12213.48aac83c@ posting.google. com> from drinker contained
    the following:
    [color=blue]
    >start_session( );[/color]

    Try
    session_start()

    --
    Geoff Berrow (put thecat out to email)
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    • Phil Roberts

      #3
      Re: [urgen] sessiong problem

      With total disregard for any kind of safety measures
      johnny@strawber rynet.com (drinker) leapt forth and uttered:
      [color=blue]
      > Dear All,
      >
      >
      > how to put connect object to session variable like that:
      >
      > start_session() ;
      > $_SESSION['conn']=mysql_connect( 'localhost',$ui d,$pass);
      > mysql_select_db ('account',$_SE SSION['conn']);
      >
      >
      > the $_SESSION['conn'] variable cannot use in "main.php" my html:
      >
      > <form action='main.ph p' method='post'>
      > <input type=submit>
      > </form>
      >
      > how to pass $_SESSION['conn'] object to other script after
      > submit action? thank you[/color]

      Sessions store serialised string values, you cannot serialise
      database resource ID's. Besides which, it's session_start() .

      --
      Phil Roberts | Dork Pretending To Be Hard | http://www.flatnet.net/

      Comment

      • drinker

        #4
        Re: [urgen] sessiong problem

        Geoff Berrow <blthecat@ckdog .co.uk> wrote in message news:<j5p2501qb lnke9utmohnnopk fo3a6221tm@4ax. com>...[color=blue]
        > I noticed that Message-ID:
        > <666497d7.04031 12213.48aac83c@ posting.google. com> from drinker contained
        > the following:
        >[color=green]
        > >start_session( );[/color]
        >
        > Try
        > session_start()[/color]

        typo, is session_start() ;

        Comment

        • drinker

          #5
          Re: [urgen] sessiong problem

          Phil Roberts <philrob@HOLYfl atnetSHIT.net> wrote in message news:<Xns94AA52 9E0B32Bphilrobe rts@216.196.97. 132>...[color=blue]
          > With total disregard for any kind of safety measures
          > johnny@strawber rynet.com (drinker) leapt forth and uttered:
          >[color=green]
          > > Dear All,
          > >
          > >
          > > how to put connect object to session variable like that:
          > >
          > > start_session() ;
          > > $_SESSION['conn']=mysql_connect( 'localhost',$ui d,$pass);
          > > mysql_select_db ('account',$_SE SSION['conn']);
          > >
          > >
          > > the $_SESSION['conn'] variable cannot use in "main.php" my html:
          > >
          > > <form action='main.ph p' method='post'>
          > > <input type=submit>
          > > </form>
          > >
          > > how to pass $_SESSION['conn'] object to other script after
          > > submit action? thank you[/color]
          >
          > Sessions store serialised string values, you cannot serialise
          > database resource ID's. Besides which, it's session_start() .[/color]

          why i cannot serialise database resource id's?

          Comment

          • Phil Roberts

            #6
            Re: [urgen] sessiong problem

            With total disregard for any kind of safety measures
            johnny@strawber rynet.com (drinker) leapt forth and uttered:
            [color=blue]
            > Phil Roberts <philrob@HOLYfl atnetSHIT.net> wrote in message
            > news:<Xns94AA52 9E0B32Bphilrobe rts@216.196.97. 132>...[color=green]
            >> With total disregard for any kind of safety measures
            >> johnny@strawber rynet.com (drinker) leapt forth and uttered:
            >>[color=darkred]
            >> > Dear All,
            >> >
            >> >
            >> > how to put connect object to session variable like that:
            >> >
            >> > start_session() ;
            >> > $_SESSION['conn']=mysql_connect( 'localhost',$ui d,$pass);
            >> > mysql_select_db ('account',$_SE SSION['conn']);
            >> >
            >> >
            >> > the $_SESSION['conn'] variable cannot use in "main.php" my
            >> > html:
            >> >
            >> > <form action='main.ph p' method='post'>
            >> > <input type=submit>
            >> > </form>
            >> >
            >> > how to pass $_SESSION['conn'] object to other script after
            >> > submit action? thank you[/color]
            >>
            >> Sessions store serialised string values, you cannot serialise
            >> database resource ID's. Besides which, it's session_start() .[/color]
            >
            > why i cannot serialise database resource id's?
            >[/color]

            Because you just can't.

            From the PHP manual:
            [color=blue]
            > "serialize( ) handles all types, except the resource-type."[/color]

            --
            Phil Roberts | Dork Pretending To Be Hard | http://www.flatnet.net/

            Comment

            Working...