Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    mwm
    mwm is offline
    Regular Coder
    Join Date
    Oct 2005
    Posts
    174
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Php driving me nutz!

    I have php and mysql installed on a windows sbs 2003. I have written an application where it pulls info on customers and the id is passed between pages as additional info on the customer is need by the user. HERE is the problem! The customer info first page (query) works everytime, but when the id is passed to the second page to pull the info (second query) it's blank - no info at all. So, you wait an few seconds and start over and everything works again. I have been able to confirm the problem by running the application directly on the server. What could be wrong? Has this happened to anyone else, where php is slow to respond?

    Thanks

  • #2
    New Coder
    Join Date
    Nov 2006
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How are you passing the id variable to the subsequent pages? Session? Post? Get? Is the variable itself passing but the database query isn't working properly?

    Can you show us the query string (the one that works everytime and the one that doesn't)

    Need more info

    ~Uber
    Last edited by UberDragon; 11-15-2006 at 03:50 PM.

  • #3
    mwm
    mwm is offline
    Regular Coder
    Join Date
    Oct 2005
    Posts
    174
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, below are the two pages. I echo the id on each page to make sure its being passed. But like I said, id is not always being passed to the second page so the query doesn't work. Thanks for looking at this for me.
    PHP Code:
    <?
    session_start
    ();
    include 
    "conn.php";
    $community=$_POST['community'];
    $id$_POST['id'];
    echo 
    $id;
    echo 
    "<input type = 'hidden' name = 'id' value = '$id'>";


    ?>



    <html>

    <head><link rel=stylesheet type=text/css href=css/default.css>

    </head>
    <body>

    <form action = "custhistory.php" method ="POST">

    <h1><p align=center> Corporation</p></h1>
    <h3><p align=center>Home Buying Details</p></h3>
    <h3><p align=center></center></p></h3>
    <p align =center>
    <a href="guestmain.php">&nbsp;&nbsp;Main </a><a href="contactfirst1.php">&nbsp;&nbsp; Contacts </a>
    <a href="custhistory.php">&nbsp;&nbsp; History </a>
    </center>

    <br>
    <hr>

    <?



    $mysql 
    "SELECT * from cust where id = '$id' and community= '$community' ";




    $resultmysql_query($mysql) or die ("Can't connect");
    $row mysql_fetch_row($result);



    $id $row[0];




    $mysql1 "SELECT date_format(regdate, '%M-%d-%Y'), fname, lname,address,city,state,zip,hphone,cphone,wphone, email from cust where community= '$community' and id = '$id'";




    $result1mysql_query($mysql1) or die ("Can't connect");






    echo 
    "<table border=\"0\">";
    echo 
    "<th>Registered</th>";
    echo 
    "<th>Guest</th>";
    echo 
    "<th></th>";
    echo 
    "<th>Address</th>";
    echo 
    "<th>City</th>";
    echo 
    "<th>State</th>";
    echo 
    "<th>Zip</th>";
    echo 
    "<th>Phone</th>";
    echo 
    "<th>Cell</th>";
    echo 
    "<th>Work</th>";
    echo 
    "<th>Email</th>";


    $j true;
    while (
    $row mysql_fetch_row($result1))


    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result1);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";



    ?>
    <?





    $mysql2 
    "SELECT status, level, adulthousehold,childhousehold,nameage from cust where  community= '$community'and id = '$id'";

    $result2mysql_query($mysql2) or die ("Can't connect");







    echo 
    "<table border=\"0\">";
    echo 
    "<th>Status</th>";
    echo 
    "<th>Level</th>";
    echo 
    "<th>Adults</th>";
    echo 
    "<th>Children</th>";
    echo 
    "<th>Names</th>";


    $j true;
    while (
    $row mysql_fetch_row($result2))

    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result2);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";



    ?>


    <?



    $mysql3 
    "SELECT realname,realcomp,realadd,realphone from realtor where id = '$id'";




    $result3mysql_query($mysql3) or die ("Can't connect");
    echo 
    "<th>&nbsp;Realtor</th>";
    echo 
    "<table border=\"0\">";
    $j true;
    while (
    $row mysql_fetch_row($result3))

    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result3);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";



    ?>


    <hr>
    <?

    $query4 
    = ("SELECT * FROM cust where   community = '$community' and id ='$id'");
    $result4 mysql_query($query4);
    $row=mysql_fetch_row($result4);


    ?>


    <p align = center></a><?echo $row[3]?> <?echo $row[4]?> is looking for a new home with </center>
    <p align = center>2 Bedrooms <input  = "checkbox" name ="twobed" value ="<? echo $row[23]?>" size = "1"> 3 Bedrooms <input  = "checkbox" name ="threebed" value ="<? echo $row[24]?>" size = "1"> 4 Bedrooms <input  = "checkbox" name ="fourbed" value ="<? echo $row[25]?>" size = "1"> 5 or more Bedrooms <input  = "checkbox" name ="morebed" value ="<? echo $row[26]?>" size = "1"></p><p align = center> 1.5 Baths <input  = "checkbox" name ="onebath" value ="<? echo $row[27]?>" size = "1"> 2 Baths <input  = "checkbox" name ="twobaths" value ="<? echo $row[28]?>" size = "1"> 2.5 Baths <input  = "checkbox" name ="twohalfbaths" value ="<? echo $row[29]?>" size = "1"> 3 Baths <input  = "checkbox" name ="threebaths" value ="<? echo $row[30]?>" size = "1"></p><p align = center> 2 Car Garage <input  = "checkbox" name ="twogarage" value ="<? echo $row[31]?>" size = "1"> 2.5 Car Garage <input  = "checkbox" name ="twohalfgarage" value ="<? echo $row[32]?>" size = "1"> 3 Car Garage <input  = "checkbox" name ="threegarage" value ="<? echo $row[33]?>" size = "1">
    <hr>

    <p align = center><?echo $row[3]?> presently </center>
    <p align = center>Rent <input  = "checkbox" name ="rent" value ="<? echo $row[59]?>" size = "1"> Own <input  = "checkbox" name ="own" value ="<? echo $row[60]?>" size = "1"> Single Family <input  = "checkbox" name ="family" value ="<? echo $row[61]?>" size = "1"> Multifamily <input  = "checkbox" name ="multifamily" value ="<? echo $row[62]?>" size = "1"> Live with family <input  = "checkbox" name ="livefamily" value ="<? echo $row[63]?>" size = "1"> 
    <hr>
    <p align = center>Price Range 
    <input type ="text" name="price" value = "<?echo $row[64]?>" size = "12"></textarea>
    <p align = center>Move Time 
    <input type ="text" name="movetime" value = "<?echo $row[65]?>" size = "12"></textarea>
    <hr>





    <p align =center>
    <a href="guestmain.php">Main</a></center> 
    </table>


    </form>    
    </body>
    </html>
    PHP Code:
    <?
    session_start
    ();
    include 
    "conn.php";
    session_register("id");

    echo 
    "<input type = 'hidden' name = 'id' value = '$id'>";
    echo 
    $id;

    ?>




    <html>

    <head><link rel=stylesheet type=text/css href=css/default.css>

    </head>
    <body>
    <form action = "followupdate.php"  method ="POST">
    <h1><p align=center>The Corporation</p></h1>
    <h3><p align=center>Guest History </p></h3>
    <h3><p align=center></center></p></h3>
    <p align =center>
    <a href="guestmain.php">&nbsp;&nbsp;Main </a><a href="contactfirst1.php">&nbsp;&nbsp; Contacts </a>
    <?echo $row[11]?><a href="exceptionone.php">&nbsp;&nbsp; Exception Report <a href="contacteditfour.php">&nbsp;&nbsp;  Status Change </a><a href="addtouch.php">&nbsp;&nbsp;  Add Touch/Note </a><a href="earnestone.php">&nbsp;&nbsp;  Earnest </a></center>
    <input type = "hidden" name = "tpcount" value = "1">

    <br>
    <hr>




    <?

    echo "<input type = 'hidden' name = 'id' value = '$id'>";

    $mysql "SELECT * from cust where id = '$id'";



    $resultmysql_query($mysql) or die ("Can't connect");
    $row mysql_fetch_row($result);

    $id $row[0];


    $mysql1 "SELECT fname,lname,address,city,state,zip,hphone,cphone,wphone, email from cust where  id = '$id'";







    $result1mysql_query($mysql1) or die ("Can't connect");






    echo 
    "<table border=\"0\">";
    echo 
    "<th>Guest</th>";
    echo 
    "<th></th>";
    echo 
    "<th>Address</th>";
    echo 
    "<th>City</th>";
    echo 
    "<th>State</th>";
    echo 
    "<th>Zip</th>";
    echo 
    "<th>Phone</th>";
    echo 
    "<th>Cell</th>";
    echo 
    "<th>Work</th>";
    echo 
    "<th>Email</th>";


    $j true;
    while (
    $row mysql_fetch_row($result1))


    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result1);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";






    ?>

    <?

    $mysql2 
    "SELECT status,model,elevation,lot from cust where  id = '$id'";



    $result2mysql_query($mysql2) or die ("Can't connect");





    echo 
    "<table border=\"0\">";
    echo 
    "<th>Status</th>";
    echo 
    "<th>Model</th>";
    echo 
    "<th>Elevation</th>";
    echo 
    "<th>Lot</th>";


    $j true;
    while (
    $row mysql_fetch_row($result2))

    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result2);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";

    ?>

    <hr>
    <br>
    <?

    $mysql4 
    "SELECT tpoint, date_format(tpdate, '%M-%d-%Y') from followup where id = '$id' order by tpdate";


    $result4mysql_query($mysql4) or die ("Can't connect");




    echo 
    "<table border=\"0\">";
    echo 
    "<th>Touch</th>";
    echo 
    "<th>Date</th>";


    $j true;
    while (
    $row mysql_fetch_row($result4))


    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result4);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";

    ?>
    <hr>
    <br>
    <?

    $mysql6 
    "SELECT demo, date_format(demodate, '%M-%d-%Y') from demotbl where id = '$id' order by demodate";


    $result6mysql_query($mysql6) or die ("Can't connect");




    echo 
    "<h4>";
    echo 
    "<table border=\"0\">";
    echo 
    "<th>Demo</th>";
    echo 
    "<th>Date</th>";
    echo 
    "</h4>";

    $j true;
    while (
    $row mysql_fetch_row($result6))


    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result6);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";

    ?>
    <hr>
    <br>
    <?

    $mysql7 
    "SELECT  date_format(appdate, '%M-%d-%Y') from apptbl where id = '$id' order by appdate";


    $result7mysql_query($mysql7) or die ("Can't connect");






    echo 
    "<table border=\"0\">";
    echo 
    "<th>Appointments</th>";



    $j true;
    while (
    $row mysql_fetch_row($result7))


    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result7);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";

    ?>

    <?
    echo "<center>Notes</center>";
    $mysql5 "SELECT * from followup where id = '$id'";

    $result5mysql_query($mysql5) or die ("Can't connect");

    $num_results mysql_num_rows($result5);



    for (
    $i=0;$i<$num_results$i++)

     
    {


     
    $row mysql_fetch_array($result5);

    echo 
    "<center><table border='0' width='80%'> ";
        echo 
    "<tr><th align=left Width =80%></th></tr>";


        echo 
    "</td><td align=left>";
        echo 
    $row['6'];

        


        echo 
    "</td></tr>";
        echo 
    "</table>";
     


    }

    if (
    $num_results==0) echo "No Records";

    ?>




    </form>
    </body>
    </html>

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,471
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    I don't know if this helps, but keep this in mind ...

    Once you define a variable, example $id ...
    That variable is global. You can move from script-to-script
    and $id remains as-is. That might be related to your problem,
    where you are re-defining it instead of leaving it alone.

  • #5
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,026
    Thanks
    2
    Thanked 315 Times in 307 Posts
    The hidden field with the id in it in the first code is not located within the <form...> </form> tags and won't be passed by the browser to the next page. Only data that is submitted by the browser using forms, or contained in parameters as part of the URL, or stored in sessions or cookies are available between pages.
    Last edited by CFMaBiSmAd; 11-15-2006 at 05:36 PM.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #6
    mwm
    mwm is offline
    Regular Coder
    Join Date
    Oct 2005
    Posts
    174
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have tried everything I could think of to get the id to pass consistenly. But the scripts still insert into the db a 0 instead of the correct id. This happens every once an a while. COULD SOME CORRECT ME ON WHAT I'M DOING WRONG. THANKS.
    The two scripts are below

    PHP Code:
    <?
    session_start
    ();
    include 
    "conn.php";
    $community=$_POST['community'];
    $id$_POST['id'];
    echo 
    "Customer ID $id";

    ?>



    <html>

    <head><link rel=stylesheet type=text/css href=css/default.css>

    </head>
    <body>

    <form action = "custhistory.php" method ="POST">

    <h1><p align=center></p></h1>
    <h3><p align=center>Home Buying Details</p></h3>
    <h3><p align=center></center></p></h3>
    <p align =center>
    <a href="guestmain.php">&nbsp;&nbsp;Main </a><a href="contactfirst1.php">&nbsp;&nbsp; Contacts </a>
    <a href="custhistory.php">&nbsp;&nbsp; History </a>
    </center>

    <br>
    <hr>

    <?

    echo "<input type = 'hidden' name = 'id' value = '$id'>";

    $mysql "SELECT * from cust where id = '$id' and community= '$community' ";




    $resultmysql_query($mysql) or die ("Can't connect");
    $row mysql_fetch_row($result);



    $id $row[0];




    $mysql1 "SELECT date_format(regdate, '%M-%d-%Y'), fname, lname,address,city,state,zip,hphone,cphone,wphone, email from cust where community= '$community' and id = '$id'";




    $result1mysql_query($mysql1) or die ("Can't connect");







    echo 
    "<table border=\"0\">";
    echo 
    "<th>Registered</th>";
    echo 
    "<th>Guest</th>";
    echo 
    "<th></th>";
    echo 
    "<th>Address</th>";
    echo 
    "<th>City</th>";
    echo 
    "<th>State</th>";
    echo 
    "<th>Zip</th>";
    echo 
    "<th>Phone</th>";
    echo 
    "<th>Cell</th>";
    echo 
    "<th>Work</th>";
    echo 
    "<th>Email</th>";


    $j true;
    while (
    $row mysql_fetch_row($result1))


    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result1);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";



    ?>
    <?





    $mysql2 
    "SELECT status, level, adulthousehold,childhousehold,nameage from cust where  community= '$community'and id = '$id'";

    $result2mysql_query($mysql2) or die ("Can't connect");







    echo 
    "<table border=\"0\">";
    echo 
    "<th>Status</th>";
    echo 
    "<th>Level</th>";
    echo 
    "<th>Adults</th>";
    echo 
    "<th>Children</th>";
    echo 
    "<th>Names</th>";


    $j true;
    while (
    $row mysql_fetch_row($result2))

    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result2);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";



    ?>


    <?



    $mysql3 
    "SELECT realname,realcomp,realadd,realphone from realtor where id = '$id'";




    $result3mysql_query($mysql3) or die ("Can't connect");
    echo 
    "<th>&nbsp;Realtor</th>";
    echo 
    "<table border=\"0\">";
    $j true;
    while (
    $row mysql_fetch_row($result3))

    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result3);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";



    ?>


    <hr>
    <?

    $query4 
    = ("SELECT * FROM cust where   community = '$community' and id ='$id'");
    $result4 mysql_query($query4);
    $row=mysql_fetch_row($result4);


    ?>


    <p align = center></a><?echo $row[3]?> <?echo $row[4]?> is looking for a new home with </center>
    <p align = center>2 Bedrooms <input  = "checkbox" name ="twobed" value ="<? echo $row[23]?>" size = "1"> 3 Bedrooms <input  = "checkbox" name ="threebed" value ="<? echo $row[24]?>" size = "1"> 4 Bedrooms <input  = "checkbox" name ="fourbed" value ="<? echo $row[25]?>" size = "1"> 5 or more Bedrooms <input  = "checkbox" name ="morebed" value ="<? echo $row[26]?>" size = "1"></p><p align = center> 1.5 Baths <input  = "checkbox" name ="onebath" value ="<? echo $row[27]?>" size = "1"> 2 Baths <input  = "checkbox" name ="twobaths" value ="<? echo $row[28]?>" size = "1"> 2.5 Baths <input  = "checkbox" name ="twohalfbaths" value ="<? echo $row[29]?>" size = "1"> 3 Baths <input  = "checkbox" name ="threebaths" value ="<? echo $row[30]?>" size = "1"></p><p align = center> 2 Car Garage <input  = "checkbox" name ="twogarage" value ="<? echo $row[31]?>" size = "1"> 2.5 Car Garage <input  = "checkbox" name ="twohalfgarage" value ="<? echo $row[32]?>" size = "1"> 3 Car Garage <input  = "checkbox" name ="threegarage" value ="<? echo $row[33]?>" size = "1">
    <hr>

    <p align = center><?echo $row[3]?> presently </center>
    <p align = center>Rent <input  = "checkbox" name ="rent" value ="<? echo $row[59]?>" size = "1"> Own <input  = "checkbox" name ="own" value ="<? echo $row[60]?>" size = "1"> Single Family <input  = "checkbox" name ="family" value ="<? echo $row[61]?>" size = "1"> Multifamily <input  = "checkbox" name ="multifamily" value ="<? echo $row[62]?>" size = "1"> Live with family <input  = "checkbox" name ="livefamily" value ="<? echo $row[63]?>" size = "1"> 
    <hr>
    <p align = center>Price Range 
    <input type ="text" name="price" value = "<?echo $row[64]?>" size = "12"></textarea>
    <p align = center>Move Time 
    <input type ="text" name="movetime" value = "<?echo $row[65]?>" size = "12"></textarea>
    <hr>





    <p align =center>
    <a href="guestmain.php">Main</a></center> 
    </table>


    </form>    
    </body>
    </html>
    PHP Code:
    <?
    session_start
    ();
    include 
    "conn.php";
    session_register("id");
    echo 
    "Customer ID $id";

    ?>




    <html>

    <head><link rel=stylesheet type=text/css href=css/default.css>

    </head>
    <body>
    <form action = "followupdate.php"  method ="POST">
    <h1><p align=center></p></h1>
    <h3><p align=center>Guest History </p></h3>
    <h3><p align=center></center></p></h3>
    <p align =center>
    <a href="guestmain.php">&nbsp;&nbsp;Main </a><a href="contactfirst1.php">&nbsp;&nbsp; Contacts </a>
    <?echo $row[11]?><a href="exceptionone.php">&nbsp;&nbsp; Exception Report <a href="contacteditfour.php">&nbsp;&nbsp;  Status Change </a><a href="addtouch.php">&nbsp;&nbsp;  Add Touch/Note </a><a href="earnestone.php">&nbsp;&nbsp;  Earnest </a></center>
    <input type = "hidden" name = "tpcount" value = "1">

    <br>
    <hr>




    <?

    echo "<input type = 'hidden' name = 'id' value = '$id'>";

    $mysql "SELECT * from cust where id = '$id'";




    $resultmysql_query($mysql) or die ("Can't connect");
    $row mysql_fetch_row($result);

    $id $row[0];

    $mysql1 "SELECT fname,lname,address,city,state,zip,hphone,cphone,wphone, email from cust where  id = '$id'";







    $result1mysql_query($mysql1) or die ("Can't connect");






    echo 
    "<table border=\"0\">";
    echo 
    "<th>Guest</th>";
    echo 
    "<th></th>";
    echo 
    "<th>Address</th>";
    echo 
    "<th>City</th>";
    echo 
    "<th>State</th>";
    echo 
    "<th>Zip</th>";
    echo 
    "<th>Phone</th>";
    echo 
    "<th>Cell</th>";
    echo 
    "<th>Work</th>";
    echo 
    "<th>Email</th>";


    $j true;
    while (
    $row mysql_fetch_row($result1))


    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result1);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";






    ?>

    <?

    $mysql2 
    "SELECT status,model,elevation,lot from cust where  id = '$id'";



    $result2mysql_query($mysql2) or die ("Can't connect");





    echo 
    "<table border=\"0\">";
    echo 
    "<th>Status</th>";
    echo 
    "<th>Model</th>";
    echo 
    "<th>Elevation</th>";
    echo 
    "<th>Lot</th>";


    $j true;
    while (
    $row mysql_fetch_row($result2))

    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result2);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";

    ?>

    <hr>
    <br>
    <?

    $mysql4 
    "SELECT tpoint, date_format(tpdate, '%M-%d-%Y') from followup where id = '$id' order by tpdate";


    $result4mysql_query($mysql4) or die ("Can't connect");




    echo 
    "<table border=\"0\">";
    echo 
    "<th>Touch</th>";
    echo 
    "<th>Date</th>";


    $j true;
    while (
    $row mysql_fetch_row($result4))


    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result4);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";

    ?>
    <hr>
    <br>
    <?

    $mysql6 
    "SELECT demo, date_format(demodate, '%M-%d-%Y') from demotbl where id = '$id' order by demodate";


    $result6mysql_query($mysql6) or die ("Can't connect");




    echo 
    "<h4>";
    echo 
    "<table border=\"0\">";
    echo 
    "<th>Demo</th>";
    echo 
    "<th>Date</th>";
    echo 
    "</h4>";

    $j true;
    while (
    $row mysql_fetch_row($result6))


    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result6);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";

    ?>
    <hr>
    <br>
    <?

    $mysql7 
    "SELECT  date_format(appdate, '%M-%d-%Y') from apptbl where id = '$id' order by appdate";


    $result7mysql_query($mysql7) or die ("Can't connect");






    echo 
    "<table border=\"0\">";
    echo 
    "<th>Appointments</th>";



    $j true;
    while (
    $row mysql_fetch_row($result7))


    {
        if(
    $j)
            
    $jfalse;

    else
            
    $j=true;
    echo 
    "<tr>";
    for (
    $i=0;$i<mysql_num_fields($result7);$i++) {
    if (
    $j) {

        echo 
    "<td bgcolor=\"#CCFF99\">";

    }
    if (!
    $j) {

        echo 
    "<td bgcolor=\"#FFFFCC\">";
    }
    echo 
    $row[$i];
    echo 
    "</td>";

    }

    }
    echo 
    "</table>";

    ?>

    <?
    echo "<center>Notes</center>";
    $mysql5 "SELECT * from followup where id = '$id'";

    $result5mysql_query($mysql5) or die ("Can't connect");

    $num_results mysql_num_rows($result5);



    for (
    $i=0;$i<$num_results$i++)

     
    {


     
    $row mysql_fetch_array($result5);

    echo 
    "<center><table border='0' width='80%'> ";
        echo 
    "<tr><th align=left Width =80%></th></tr>";


        echo 
    "</td><td align=left>";
        echo 
    $row['6'];

        


        echo 
    "</td></tr>";
        echo 
    "</table>";
     


    }

    if (
    $num_results==0) echo "No Records";

    ?>




    </form>
    </body>
    </html>

  • #7
    New Coder
    Join Date
    Nov 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You are assigning ID from a post variable, do you have an input that is named ID?, I don't see it.

  • #8
    mwm
    mwm is offline
    Regular Coder
    Join Date
    Oct 2005
    Posts
    174
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, the id is be pulled from the database in the first script. Thanks for taking the time to help me out.

  • #9
    New Coder
    Join Date
    Nov 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is the problem that the ID is not passing to the next page?

    Are you posting to the second page? If so, on the second page (the one being posted to) assign $id to $_POST['id'], you don't need to use session register.. then if you want to turn the id value into a session variable, do $_SESSION['id'] = $id (or $_POST['id'])

  • #10
    mwm
    mwm is offline
    Regular Coder
    Join Date
    Oct 2005
    Posts
    174
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, the id is not alway passed to the second script.

  • #11
    New Coder
    Join Date
    Nov 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    On the second page, replace
    session_register("id");

    with

    $id = $_POST['id']

    Then see if it echos

  • #12
    mwm
    mwm is offline
    Regular Coder
    Join Date
    Oct 2005
    Posts
    174
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK I did and it won't echo..That is the strange thing. When i use the session id it will echo 90% of the time. The other 10% it won't. But when i use $id = $_POST['id'];
    it doesn't echo at all.

  • #13
    New Coder
    Join Date
    Nov 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    On the first page, when you view source... for the id field, does it have a value?

  • #14
    mwm
    mwm is offline
    Regular Coder
    Join Date
    Oct 2005
    Posts
    174
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, on the first page I have always been able to echo the id.

  • #15
    New Coder
    Join Date
    Nov 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not just echo the ID, but specifically that your field named 'id' has a value.. also remove all the extra spacing..


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •