Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Connecting to DB seems to clear my _SESSION variables- why?
Old 02-03-2006, 11:25 AM Connecting to DB seems to clear my _SESSION variables- why?
Junior Talker

Posts: 4
Trades: 0
Hello all,

I have a wonderful php app that transfers variables from page to page w/ $_SESSION variables. (it is a checkout form)

It has been working fine for weeks, and I added some code yesterday which seems to have screwed everything up. When the code is on the page, my session variables don't transfer anymore. The code has NOTHING to do with session variables, or so I thought.

The new script is a simple loop that connects to a database to fill the options for a select box. The script is as follows:

Code:
 
  <?php
 
  $conn = mysql_connect("location", "uname", "pword");
  mysql_select_db("dbName", $conn);
  $sql = "SELECT fldMake FROM tblMakes ORDER BY fldMake";
  $result = mysql_query($sql, $conn) or die(mysql_error());
  while ($newArray = mysql_fetch_array($result))
  {
  $mk = $newArray['fldMake'];
  print("<option>".$mk."</option>");
  }
  mysql_close($conn);
 
  ?>
The code works fine. But now when the form is submitted I can not fill session variables with $_POST like I had been doing.

Any ideas?

Thanks,
Stan
Stanly22 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-05-2006, 05:32 PM Re: Connecting to DB seems to clear my _SESSION variables- why?
neroux's Avatar
Ultra Talker

Posts: 284
Trades: 0
Can you post the full code? Did you maybe put the code before the session_start() call, so that the server cant issue the session cookie anymore?

Try to comment out the new code and then "reactivate" the code line by line to see whether you can spot the error.
__________________

Please login or register to view this content. Registration is FREE
- The world at your fingertips
• Share your city with the world

--
Please login or register to view this content. Registration is FREE
neroux is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Connecting to DB seems to clear my _SESSION variables- why?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13295 seconds with 12 queries