----- Original Message ----- 
  From: Steve Penney 
  To: [email protected] 
  Sent: Thursday, November 17, 2005 6:54 AM
  Subject: [php_mysql] $_SESSION variable - please HELP


  Hello, I am new to this group and php mysql programming. I have
  been a MSAccess programmer for years. I have a web site hosted on 
  Yahoo where I want to query the mysql database from a form on one
  page and return query results on another. I have been trying to do
  this for two weeks and for the life of me cannot figure out what I am
  doing wrong. Any help would be appreciated.
  PHP Version 4.3.11
  phpMyAdmin 2.6.3-pl1
  session.auto_start = off




  1st form - test.php
  <?php
  session_start();
  >?
  //.............
  <form method= "POST" action="GetForm.php">
  ID: <input type="text" name="first" />
  <input type="submit" />
  </form>
  //.........
  <?php
  $fname = $_POST["first"];
  $_SESSION["first"]= $fname;
  ?>


  2nd form - GetForm.php
  <?php
  session_start();
  echo $_SESSION["first"];
  $NAMEID = $_SESSION["first"];
  echo $NAMEID;
  //..........
  $query = "SELECT * FROM inventory WHERE ID=$NAMEID";

  ERROR MESSAGE is below.
  Query failed: You have an error in your SQL syntax; check the manual
  that corresponds to your MySQL server version for the right syntax to
  use near '' at line 1

  I do not see the $_SESSION variable carrying the form input to the
  echo statement on the second form. Is this due to something not set
  properly?
  thanks,
  Steve







  The php_mysql group is dedicated to learn more about the PHP/MySQL web 
database possibilities through group learning. 



  SPONSORED LINKS American general life and accident insurance company  
American general life insurance company  American general life  
        American general mortgage  American general life insurance  Computer 
internet security  


------------------------------------------------------------------------------
  YAHOO! GROUPS LINKS 

    a..  Visit your group "php_mysql" on the web.
      
    b..  To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]
      
    c..  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


------------------------------------------------------------------------------



[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/CefplB/TM
--------------------------------------------------------------------~-> 

The php_mysql group is dedicated to learn more about the PHP/MySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to