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 24
  1. #1
    New Coder
    Join Date
    Aug 2012
    Posts
    65
    Thanks
    5
    Thanked 0 Times in 0 Posts

    PHP script not running

    Hello everyone, back to this script you guys helped with earlier. I have everything else working now except for my 'update' page and script. when the user selects a criteria and hits the search button, all works well. The problem, however, is that with ever output record is a 'details' button that when pressed will take them to a page with that specific records details on it and allow them to modify or delete it. When the press the button though, it just takes you back to the same page without any records on it. Any see something wrong with my code or have any ideas?

    Main Page:
    PHP Code:
    <center><h1><u> MSAG Database </u></h1>
    <br>            
    <br>
            
    <?php include 'includes/menu.php'?>
                
    <form method="post" action="index.php">
    <input type="hidden" name="submitted" value="true" />

    <label>Search Category:

    <select name="category">
        <option value="StreetName">Street Name</option>
        <option value="LOWNUMBER">Low Range</option>
        <option value="HighNumber">High Range</option>
        <option value="EOB">OEB</option>
        <option value="ESN">ESN Number</option>
        <option value="COMMUNITY">Community</option>
        <option value="TELCO">Telco</option>
        <option value="MAP">Map Number</option>
        <option value="DateEntered">Entry Date</option>
        <option value="DateUpdated">Last Modified</option>
    </select>
    </label>

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>Search Criteria: <input type="text" name="criteria" /></label>

    <input type="submit" name="search" value="Search"/>

    </form>

    </center>
    <?php

    include 'includes/db/connect.php';

    if(isset(
    $_POST['search']) || isset($_POST['submit']))
    {     
        
    $category $_POST['category'];
        
    $criteria $_POST['criteria'];
        
        
    $query "SELECT * FROM MSAG WHERE $category LIKE '%$criteria%' ORDER BY StreetName ASC";
        
    $resource=sqlsrv_query($conn$query) or die(print_r(sqlsrv_errors(), true));


    echo 
    "
    <form action=\"\" method=\"post\">
            <table align=\"center\" border=\"1\" cellpadding=\"2\" cellspacing=\"2\" width=\"100%\" >
            <tr align = 'center'>
                <td><b>Prefix</b></td>
                <td><b>Street Name</b></td>
                <td><b>Low</b></td>
                <td><b>High</b></td>
                <td><b>OEB</b></td>
                <td><b>ESN #</b></td>
                <td><b>Community</b></td>
                <td><b>Telco</b></td>
                <td><b>Map #</b></td>
                <td><b>Entry Date</b></td>
                <td><b>Last Modified</b></td>
                <td><b>Details</b></td>
            </tr>
    "
    ;

    while(
    $result=sqlsrv_fetch_array($resource))

        echo 
    "
    <tr align = center>
    <td>"
    .$result['StreetPrefix']."</td>
    <td>"
    .$result['StreetName']."</td>
    <td>"
    .$result['LOWNUMBER']."</td>
    <td>"
    .$result['HighNumber']."</td>
    <td>"
    .$result['EOB']."</td>
    <td>"
    .$result['ESN']."</td>
    <td>"
    .$result['COMMUNITY']."</td>
    <td>"
    .$result['TELCO']."</td>
    <td>"
    .$result['MAP']."</td>
    <td>"
    .(($result['DateEntered'] instanceof DateTime) ? $result['DateEntered']->format('Y-m-d') : $result['DateEntered']) ." </td>
    <td>"
    .(($result['DateUpdated'] instanceof DateTime) ? $result['DateUpdated']->format('Y-m-d') : $result['DateUpdated']) ." </td>
    <td><a href=\"modify2.php?StreetID="
    .$result['StreetID']."\"><input type=\"submit\" name = \"details\" value = \"Details\" /></a></td>
    </tr>
    "
    ;         
    }
    }    
    ?>
    </table>
    </form>
    update/delete page:
    PHP Code:
    <?php
    include 'includes/db/connect.php';
    $_StreetID = (int)($_GET['StreetID']);
    $_sql ="SELECT * FROM `records` WHERE `StreetID`=$_StreetID";
    $_rs mysql_query($_sql);
    while(
    $_rw mysql_fetch_assoc($_rs))
    {
        
    $_StreetID $_rw['StreetID'];
        
    $_StreetPrefix $_rw['StreetPrefix'];
        
    $_StreetName $_rw['StreetName'];
        
    $_LOWNUMBER $_rw['LOWNUMBER'];
        
    $_HighNumber $_rw['HighNumber'];
        
    $_EOB $_rw['EOB'];
        
    $_ESN $_rw['ESN'];
        
    $_COMMUNITY $_rw['COMMUNITY'];
        
    $_TELCO $_rw['TELCO'];
        
    $_MAP $_rw['MAP'];    
        
    $_DateEntered $_rw['DateEntered'];
        
    $_DateModified $_rw['DateModified'];
    }

    if(isset(
    $_POST['edit'])) 

        
    $_StreetPrefix $_rw['StreetPrefix'];
        
    $_StreetName $_rw['StreetName'];
        
    $_LOWNUMBER $_rw['LOWNUMBER'];
        
    $_HighNumber $_rw['HighNumber'];
        
    $_EOB $_rw['EOB'];
        
    $_ESN $_rw['ESN'];
        
    $_COMMUNITY $_rw['COMMUNITY'];
        
    $_TELCO $_rw['TELCO'];
        
    $_MAP $_rw['MAP'];    
        
    $_DateEntered $_rw['DateEntered'];
        
    $_DateModified $_rw['DateModified'];
        
    $_StreetID $_rw['StreetID']; 
       
      
    $_SQL "UPDATE `records` SET `StreetPrefix`='$_StreetPrefix',  
                                    `StreetName`='$_StreetName',  
                                    `LOWNUMBER`='$_LOWNUMBER',
                                    `HighNumber`='$_HighNumber',
                                    `EOB`='$_EOB',
                                    `ESN`='$_ESN',
                                    `COMMUNITY`='$_COMMUNITY',
                                    `TELCO`='$_TELCO',
                                    `MAP`='$_MAP',
                                    `DateEntered`='$_DateEntered',
                                    `DateModified`='$_DateModified'
                          WHERE `StreetID`='$_StreetID'"

            
      
    mysql_query($_SQL) or die(mysql_error()); 
      
    //header("Location : index.php?id=$_id"); 
      
    $_html ="<tabel><tr>  
           <td width=\"19%\">RECORD HAS BEEN </td> 
           <td width=\"81%\">UPDATED CLICK <a href=\"index.php\">HERE</a></td> 
         </tr></table>"


    elseif(isset(
    $_POST['delete'])) 

        
    $id = (int)$_POST['id']; 
        
    mysql_query("DELETE FROM `records` WHERE `StreetID`='$StreetID' LIMIT 1"); 
        
    $_html 'Record deleted successfully!<br/><a href="index.php">Return to "Home" page.</a>'

            if (
    "default" != GetFileName($_POST['_front'])){
        
    unlink($_POST['_front']);
        }
        if (
    "default" != GetFileName($_POST['_rear'])){
        
    unlink($_POST['_rear']);
        }
        if (
    "default" != GetFileName($_POST['_right'])){
        
    unlink($_POST['_right']);
        }
        if (
    "default" != GetFileName($_POST['_left'])){
        
    unlink($_POST['_left']);
        }
        if (
    "default" != GetFileName($_POST['_intfront'])){
        
    unlink($_POST['_intfront']);
        }
        if (
    "default" != GetFileName($_POST['_intrear'])){
        
    unlink($_POST['_intrear']);
        }


    else 

    $_html=" <center>
    <form action=\"\" method=\"post\" id=\"_form\" name=\"_form\" enctype=\"multipart/form-data\">

    <table> 
    <tr>  
    <td>Directional: <br><input type=\"text\" name=\"_StreetPrefix\"   size= \"8\" value=\"$_StreetPrefix\" /> <br></td>
    <td>Street Name: <br><input type=\"text\" name=\"_StreetName\"   size= \"50\" value=\"$_StreeName\"  /> <br></td>
    <td>Community: <br><input type=\"text\" name=\"_COMMUNITY\"   size= \"50\" value=\"$_COMMUNITY\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Low Range : <br><input type=\"text\" name=\"_LOWNUMBER\" size= \"8\" value=\"$_LOWNUMBER\" /> <br></td>
    <td>High Range: <br><input type=\"text\" name=\"_HighNumber\"   size= \"8\" value=\"$_HighNumber\"  /> <br></td>
    <td>OEB: <br><input type=\"text\" name=\"_EOB\" size= \"8\" value=\"$_EOB\" /> <br></td>
    <td>ESN Number: <br><input type=\"text\" name=\"_ESN\"   size= \"8\" value=\"$_ESN\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Telco : <br><input type=\"text\" name=\"_TELCO\" size= \"8\" value=\"$_TELCO\" /> <br></td>
    <td>Map Number: <br><input type=\"text\" name=\"_MAP\" size= \"8\" value=\"$_MAP\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Entry Date : <br><input type=\"text\" name=\"_DateEntered\" size= \"8\" value=\"$_DateEntered\" /> <br></td>
    <td>Last Modified: <br><input type=\"text\" name=\"_DateModified\"   size= \"8\" value=\"$_DateModified\" /> <br></td>
    </tr></table>
    <br>

    <table>
    <tr>
    <td>
    <input type=\"submit\" align = \"left\" name=\"edit\" value=\"Edit\"/>
    <input type=\"hidden\" name=\"id\" value=\"$_StreetID\"/>
    </td>

    <td>
    <input type=\"submit\" id=\"delete\" name=\"delete\" value=\"Delete\"/>
    <input type=\"hidden\" name=\"id\" value=\"$_StreetID\"/>
    </td>
    </tr>
    </table>
    </center>"



    ?> 
    <center>
    <h1><u>Record Details</u></h1>
    <br>
    <br>
    </center>

    <?php echo $_html?>
    Last edited by willscarlet; 11-27-2012 at 02:32 PM.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,523
    Thanks
    8
    Thanked 1,091 Times in 1,082 Posts
    This line doesn't look right:

    <td><a href=\"modify2.php?StreetID=".$result['StreetID']."\"><input type=\"submit\" name = \"details\" value = \"Details\" /></a></td>

    I wonder if the submit button totally ignores the <a href>.

    Don't make that modify section of your script a <form>.
    Remove the <form> line and remove the submit button.
    Put a graphic image in it's place ...

    <td><a href=\"modify2.php?StreetID=".$result['StreetID']."\"><img src=\"modbutton.png\" /></a></td>

  • #3
    Regular Coder
    Join Date
    Nov 2012
    Posts
    117
    Thanks
    7
    Thanked 12 Times in 12 Posts
    Quote Originally Posted by mlseim View Post
    This line doesn't look right:

    <td><a href=\"modify2.php?StreetID=".$result['StreetID']."\"><input type=\"submit\" name = \"details\" value = \"Details\" /></a></td>

    I wonder if the submit button totally ignores the <a href>.

    Don't make that modify section of your script a <form>.
    Remove the <form> line and remove the submit button.
    Put a graphic image in it's place ...

    <td><a href=\"modify2.php?StreetID=".$result['StreetID']."\"><img src=\"modbutton.png\" /></a></td>
    It does look kind of funny, and am curious whether it works at all.

    But, if you fancy using a form, put the modify2.php?StreetID=".$result['StreetID']." as form action instead of the empty string which is there now.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,523
    Thanks
    8
    Thanked 1,091 Times in 1,082 Posts
    If you make it a form action,
    use <input type=\"hidden\" name=\"StreetID\" value=\".$result['StreetID'].\">
    to POST the value.

  • #5
    Regular Coder
    Join Date
    Nov 2012
    Posts
    117
    Thanks
    7
    Thanked 12 Times in 12 Posts
    Not only that, but what actually happens here?

    PHP Code:
    if(isset($_POST['edit'])) 

        
    $_StreetPrefix $_rw['StreetPrefix'];
        
    $_StreetName $_rw['StreetName'];
        
    $_LOWNUMBER $_rw['LOWNUMBER']; 
    I'd expect something along the lines of

    PHP Code:
    if(isset($_POST['edit'])) 

        
    $_StreetPrefix $_POST['StreetPrefix'];
        
    $_StreetName $_POST['StreetName'];
        
    $_LOWNUMBER $_POST['LOWNUMBER']; 
    Might be wrong though?

  • #6
    New Coder
    Join Date
    Aug 2012
    Posts
    65
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Changinh the modify button to an image did the trick to getting the modify page to load on submit:
    PHP Code:
    <td><a href="modify2.php?StreetID=".$result['StreetID']."\"><img src=\"images/details.gif\" /></a></td> 
    Now, however, when it does load the modify page im getting a ton of errors including unknown variable errors that should not be. ive spent the last several days going over it and do not see where I am messing up.

    The errors showing up are:
    Code:
    Warning: mysql_query(): [2002] No connection could be made because the target machine actively refused it. (trying to connect via tcp://localhost:3306) in C:\Inetpub\wwwroot\msag\modify2.php on line 5 Warning: mysql_query(): No connection could be made because the target machine actively refused it. in C:\Inetpub\wwwroot\msag\modify2.php on line 5 Warning: mysql_query(): A link to the server could not be established in C:\Inetpub\wwwroot\msag\modify2.php on line 5 Notice: Undefined variable: rs in C:\Inetpub\wwwroot\msag\modify2.php on line 6 Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given in C:\Inetpub\wwwroot\msag\modify2.php on line 6 Notice: Undefined variable: _StreetPrefix in C:\Inetpub\wwwroot\msag\modify2.php on line 66 Notice: Undefined variable: _StreeName in C:\Inetpub\wwwroot\msag\modify2.php on line 67 Notice: Undefined variable: _COMMUNITY in C:\Inetpub\wwwroot\msag\modify2.php on line 73 Notice: Undefined variable: _LOWNUMBER in C:\Inetpub\wwwroot\msag\modify2.php on line 74 Notice: Undefined variable: _HighNumber in C:\Inetpub\wwwroot\msag\modify2.php on line 75 Notice: Undefined variable: _EOB in C:\Inetpub\wwwroot\msag\modify2.php on line 76 Notice: Undefined variable: _ESN in C:\Inetpub\wwwroot\msag\modify2.php on line 82 Notice: Undefined variable: _TELCO in C:\Inetpub\wwwroot\msag\modify2.php on line 83 Notice: Undefined variable: _MAP in C:\Inetpub\wwwroot\msag\modify2.php on line 89 Notice: Undefined variable: _DateEntered in C:\Inetpub\wwwroot\msag\modify2.php on line 90 Notice: Undefined variable: _DateModified in C:\Inetpub\wwwroot\msag\modify2.php on line 98
    Here is my code for that page:
    PHP Code:
    <?php
    include 'includes/db/connect.php';
    $_StreetID = (int)($_GET['StreetID']);
    $_sql ="SELECT * FROM `records` WHERE `StreetID`=$_StreetID";
    $_rs mysql_query($_sql);
    while(
    $rw mysql_fetch_assoc($rs))
    {
        
    $_StreetID $_rw['StreetID'];
        
    $_StreetPrefix $_rw['StreetPrefix'];
        
    $_StreetName $_rw['StreetName'];
        
    $_LOWNUMBER $_rw['LOWNUMBER'];
        
    $_HighNumber $_rw['HighNumber'];
        
    $_EOB $_rw['EOB'];
        
    $_ESN $_rw['ESN'];
        
    $_COMMUNITY $_rw['COMMUNITY'];
        
    $_TELCO $_rw['TELCO'];
        
    $_MAP $_rw['MAP'];    
        
    $_DateEntered $_rw['DateEntered'];
        
    $_DateModified $_rw['DateModified'];
    }

    if(isset(
    $_POST['edit'])) 

        
    $_StreetPrefix $_rw['StreetPrefix'];
        
    $_StreetName $_rw['StreetName'];
        
    $_LOWNUMBER $_rw['LOWNUMBER'];
        
    $_HighNumber $_rw['HighNumber'];
        
    $_EOB $_rw['EOB'];
        
    $_ESN $_rw['ESN'];
        
    $_COMMUNITY $_rw['COMMUNITY'];
        
    $_TELCO $_rw['TELCO'];
        
    $_MAP $_rw['MAP'];    
        
    $_DateEntered $_rw['DateEntered'];
        
    $_DateModified $_rw['DateModified'];
        
    $_StreetID $_rw['StreetID']; 
       
      
    $_SQL "UPDATE `records` SET `StreetPrefix`='$_StreetPrefix',  
                                    `StreetName`='$_StreetName',  
                                    `LOWNUMBER`='$_LOWNUMBER',
                                    `HighNumber`='$_HighNumber',
                                    `EOB`='$_EOB',
                                    `ESN`='$_ESN',
                                    `COMMUNITY`='$_COMMUNITY',
                                    `TELCO`='$_TELCO',
                                    `MAP`='$_MAP',
                                    `DateEntered`='$_DateEntered',
                                    `DateModified`='$_DateModified'
                          WHERE `StreetID`='$_StreetID'"

            
      
    mysql_query($_SQL) or die(mysql_error()); 
      
    //header("Location : index.php?id=$_id"); 
      
    $_html ="<tabel><tr>  
           <td width=\"19%\">RECORD HAS BEEN </td> 
           <td width=\"81%\">UPDATED CLICK <a href=\"index.php\">HERE</a></td> 
         </tr></table>"



    else 

    $_html=" <center>
    <form action=\"\" method=\"post\" id=\"_form\" name=\"_form\" enctype=\"multipart/form-data\">

    <table> 
    <tr>  
    <td>Directional: <br><input type=\"text\" name=\"_StreetPrefix\"   size= \"8\" value=\"$_StreetPrefix\" /> <br></td>
    <td>Street Name: <br><input type=\"text\" name=\"_StreetName\"   size= \"50\" value=\"$_StreeName\"  /> <br></td>
    <td>Community: <br><input type=\"text\" name=\"_COMMUNITY\"   size= \"50\" value=\"$_COMMUNITY\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Low Range : <br><input type=\"text\" name=\"_LOWNUMBER\" size= \"8\" value=\"$_LOWNUMBER\" /> <br></td>
    <td>High Range: <br><input type=\"text\" name=\"_HighNumber\"   size= \"8\" value=\"$_HighNumber\"  /> <br></td>
    <td>OEB: <br><input type=\"text\" name=\"_EOB\" size= \"8\" value=\"$_EOB\" /> <br></td>
    <td>ESN Number: <br><input type=\"text\" name=\"_ESN\"   size= \"8\" value=\"$_ESN\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Telco : <br><input type=\"text\" name=\"_TELCO\" size= \"8\" value=\"$_TELCO\" /> <br></td>
    <td>Map Number: <br><input type=\"text\" name=\"_MAP\" size= \"8\" value=\"$_MAP\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Entry Date : <br><input type=\"text\" name=\"_DateEntered\" size= \"8\" value=\"$_DateEntered\" /> <br></td>
    <td>Last Modified: <br><input type=\"text\" name=\"_DateModified\"   size= \"8\" value=\"$_DateModified\" /> <br></td>
    </tr></table>
    <br>

    <table>
    <tr>
    <td>
    <input type=\"submit\" align = \"left\" name=\"edit\" value=\"Edit\"/>
    <input type=\"hidden\" name=\"id\" value=\"$_StreetID\"/>
    </td>

    <td>
    <input type=\"submit\" id=\"delete\" name=\"delete\" value=\"Delete\"/>
    <input type=\"hidden\" name=\"id\" value=\"$_StreetID\"/>
    </td>
    </tr>
    </table>
    </center>"



    ?> 
    <center>
    <h1><u>Record Details</u></h1>
    <br>
    <br>
    </center>

    <?php echo $_html?>
    I am sure it has something to do with the fact that I made this code for a MySQL DB, and am now trying to re write it to work with MsSQL instead, but through testing and research, I am not seeing what I need to fix it. Any advice or help is greatly appreciated.

  • #7
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    That error is distinct. Check that your credentials supplied are valid (including target and port), and if so ensure that the socket is established on the MySQL server. It sounds like its up and running though, so there are several causes to that. Start by restarting the mysql service and logging in through the command line interface to see if that works.

    Well to make the queries work with SQLServer, you need to return it to a non-proprietary version of the SQL code. Remove the backticks. SQLServer uses square brackets. After that's done, you need to use the SQLSRV package (not the MSSQL which isn't available on Windows 5.3+ versions of PHP), not the MySQL package. Better yet, swap it completely to PDO and use a bind, since then you don't need to concern yourself with the escaping of the strings (which you are otherwise needing to deal with).

    Quick glance looks mostly alright. Move that entire first block of querying and fetching into the else clause. You can't populate the $_GET['StreetID'] from the form since you don't provide it in the querystring, but you could check for both post and get (or ugh, request) for it. Given the processing doesn't display the info, I'd say just move it. Make sure you check for the existance of the $_GET['StreetID'] before attempting to read it. Change the include to a require.

  • #8
    New Coder
    Join Date
    Aug 2012
    Posts
    65
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Okay, I replaced the firt WHILE and fetch section, got rid of backticks, and changed mysql to sqlsrv. Got rid of a few errors, but now im getting a few differernt erros. as for the variable errors, im assuming that will clear up when the errors above it are corrected. As for PDO, I have never touched it before. Would you mind giving an example?

    Error recieved:
    Code:
    Warning: sqlsrv_query() expects at least 2 parameters, 1 given in C:\Inetpub\wwwroot\msag\modify2.php on line 5 Notice: Undefined variable: rs in C:\Inetpub\wwwroot\msag\modify2.php on line 45 Warning: sqlsrv_fetch_array() expects parameter 1 to be resource, null given in C:\Inetpub\wwwroot\msag\modify2.php on line 45 Notice: Undefined variable: _StreetPrefix in C:\Inetpub\wwwroot\msag\modify2.php on line 66 Notice: Undefined variable: _StreeName in C:\Inetpub\wwwroot\msag\modify2.php on line 67 Notice: Undefined variable: _COMMUNITY in C:\Inetpub\wwwroot\msag\modify2.php on line 73 Notice: Undefined variable: _LOWNUMBER in C:\Inetpub\wwwroot\msag\modify2.php on line 74 Notice: Undefined variable: _HighNumber in C:\Inetpub\wwwroot\msag\modify2.php on line 75 Notice: Undefined variable: _EOB in C:\Inetpub\wwwroot\msag\modify2.php on line 76 Notice: Undefined variable: _ESN in C:\Inetpub\wwwroot\msag\modify2.php on line 82 Notice: Undefined variable: _TELCO in C:\Inetpub\wwwroot\msag\modify2.php on line 83 Notice: Undefined variable: _MAP in C:\Inetpub\wwwroot\msag\modify2.php on line 89 Notice: Undefined variable: _DateEntered in C:\Inetpub\wwwroot\msag\modify2.php on line 90 Notice: Undefined variable: _DateModified in C:\Inetpub\wwwroot\msag\modify2.php on line 98

    New Script:
    PHP Code:
    <?php
    include 'includes/db/connect.php';
    $_StreetID = (int)($_GET['StreetID']);
    $_sql ="SELECT * FROM records WHERE StreetID=$_StreetID";
    $_rs sqlsrv_query($_sql);

    if(isset(
    $_POST['edit'])) 

        
    $_StreetPrefix $_rw['StreetPrefix'];
        
    $_StreetName $_rw['StreetName'];
        
    $_LOWNUMBER $_rw['LOWNUMBER'];
        
    $_HighNumber $_rw['HighNumber'];
        
    $_EOB $_rw['EOB'];
        
    $_ESN $_rw['ESN'];
        
    $_COMMUNITY $_rw['COMMUNITY'];
        
    $_TELCO $_rw['TELCO'];
        
    $_MAP $_rw['MAP'];    
        
    $_DateEntered $_rw['DateEntered'];
        
    $_DateModified $_rw['DateModified'];
        
    $_StreetID $_rw['StreetID']; 
       
      
    $_SQL "UPDATE records SET StreetPrefix='$_StreetPrefix',  
                                    StreetName='$_StreetName',  
                                    LOWNUMBER='$_LOWNUMBER',
                                    HighNumber='$_HighNumber',
                                    EOB='$_EOB',
                                    ESN='$_ESN',
                                    COMMUNITY='$_COMMUNITY',
                                    TELCO='$_TELCO',
                                    MAP='$_MAP',
                                    DateEntered='$_DateEntered',
                                    DateModified='$_DateModified'
                          WHERE StreetID='$_StreetID'"

            
     
    sqlsrv_query($_SQL) or die(sqlsrv_error()); 
      
    //header("Location : index.php?id=$_id"); 
      
    $_html ="<tabel><tr>  
           <td width=\"19%\">RECORD HAS BEEN </td> 
           <td width=\"81%\">UPDATED CLICK <a href=\"index.php\">HERE</a></td> 
         </tr></table>"



    else 
    {
    while(
    $rw sqlsrv_fetch_array($rs))
    {
        
    $_StreetID $_rw['StreetID'];
        
    $_StreetPrefix $_rw['StreetPrefix'];
        
    $_StreetName $_rw['StreetName'];
        
    $_LOWNUMBER $_rw['LOWNUMBER'];
        
    $_HighNumber $_rw['HighNumber'];
        
    $_EOB $_rw['EOB'];
        
    $_ESN $_rw['ESN'];
        
    $_COMMUNITY $_rw['COMMUNITY'];
        
    $_TELCO $_rw['TELCO'];
        
    $_MAP $_rw['MAP'];    
        
    $_DateEntered $_rw['DateEntered'];
        
    $_DateModified $_rw['DateModified'];
    }
    $_html=" <center>
    <form action=\"\" method=\"post\" id=\"_form\" name=\"_form\" enctype=\"multipart/form-data\">

    <table> 
    <tr>  
    <td>Directional: <br><input type=\"text\" name=\"_StreetPrefix\"   size= \"8\" value=\"$_StreetPrefix\" /> <br></td>
    <td>Street Name: <br><input type=\"text\" name=\"_StreetName\"   size= \"50\" value=\"$_StreeName\"  /> <br></td>
    <td>Community: <br><input type=\"text\" name=\"_COMMUNITY\"   size= \"50\" value=\"$_COMMUNITY\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Low Range : <br><input type=\"text\" name=\"_LOWNUMBER\" size= \"8\" value=\"$_LOWNUMBER\" /> <br></td>
    <td>High Range: <br><input type=\"text\" name=\"_HighNumber\"   size= \"8\" value=\"$_HighNumber\"  /> <br></td>
    <td>OEB: <br><input type=\"text\" name=\"_EOB\" size= \"8\" value=\"$_EOB\" /> <br></td>
    <td>ESN Number: <br><input type=\"text\" name=\"_ESN\"   size= \"8\" value=\"$_ESN\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Telco : <br><input type=\"text\" name=\"_TELCO\" size= \"8\" value=\"$_TELCO\" /> <br></td>
    <td>Map Number: <br><input type=\"text\" name=\"_MAP\" size= \"8\" value=\"$_MAP\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Entry Date : <br><input type=\"text\" name=\"_DateEntered\" size= \"8\" value=\"$_DateEntered\" /> <br></td>
    <td>Last Modified: <br><input type=\"text\" name=\"_DateModified\"   size= \"8\" value=\"$_DateModified\" /> <br></td>
    </tr></table>
    <br>

    <table>
    <tr>
    <td>
    <input type=\"submit\" align = \"left\" name=\"edit\" value=\"Edit\"/>
    <input type=\"hidden\" name=\"id\" value=\"$_StreetID\"/>
    </td>

    <td>
    <input type=\"submit\" id=\"delete\" name=\"delete\" value=\"Delete\"/>
    <input type=\"hidden\" name=\"id\" value=\"$_StreetID\"/>
    </td>
    </tr>
    </table>
    </center>"



    ?> 
    <center>
    <h1><u>Record Details</u></h1>
    <br>
    <br>
    </center>

    <?php echo $_html?>

  • #9
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    MySQL is pretty much the only db resource that for whatever reason they decided to force a global scope out of. Because of this, the signature usually accepts a connection resource as the last argument and is optional. Every other db library typically requires the use of the connection in scope, and requires it as the first argument (if its procedural). Another reason that PDO is a better alternative.

    I don't typically use PDO as I have a custom abstraction layer that isn't limited to just sql. Documentation is fairly straight forward though.
    PHP Code:
    $sDSN 'sqlsrv:Server=localhost;Database=urdb';
    $sUser 'UrUser';
    $sPass 'UrPass';

    $pdo = new PDO($sDSN$sUser$sPass);
    $stmt $pdo->prepare('UPDATE records SET StreetPrefix=?, ...');
    $stmt->execute(array($_streetPrefix, ...)); 
    Dormlich can give much better examples of PDO usage and error handling.

    Also, all of this logic needs to move to the else:
    PHP Code:
    $_StreetID = (int)($_GET['StreetID']);
    $_sql ="SELECT * FROM records WHERE StreetID=$_StreetID";
    $_rs sqlsrv_query($_sql); 

  • #10
    New Coder
    Join Date
    Aug 2012
    Posts
    65
    Thanks
    5
    Thanked 0 Times in 0 Posts
    I added the $conn variable to the first sqsrv query and it cleared that error. I decided to print oujt the errors a little different and this is what I came up with:
    [CODE]Notice: Undefined variable: rs in C:\Inetpub\wwwroot\msag\modify2.php on line 53 Warning: sqlsrv_fetch_array(): supplied resource is not a valid ss_sqlsrv_stmt resource in C:\Inetpub\wwwroot\msag\modify2.php on line 53 Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -14
    Code:
     => -14 [2] => An invalid parameter was passed to sqlsrv_fetch_array. [message] => An invalid parameter was passed to sqlsrv_fetch_array. ) )
    The new code is:
    PHP Code:
    <?php include 'includes/head/head_main.php'?>

    <div id = "top_content">
    <body>

    <?php include 'includes/header/header_main.php'?>

    <?php
    include 'includes/db/connect.php';

    if(isset(
    $_POST['edit'])) 

        
    $_StreetPrefix $_rw['StreetPrefix'];
        
    $_StreetName $_rw['StreetName'];
        
    $_LOWNUMBER $_rw['LOWNUMBER'];
        
    $_HighNumber $_rw['HighNumber'];
        
    $_EOB $_rw['EOB'];
        
    $_ESN $_rw['ESN'];
        
    $_COMMUNITY $_rw['COMMUNITY'];
        
    $_TELCO $_rw['TELCO'];
        
    $_MAP $_rw['MAP'];    
        
    $_DateEntered $_rw['DateEntered'];
        
    $_DateModified $_rw['DateModified'];
        
    $_StreetID $_rw['StreetID']; 
       
      
    $_SQL "UPDATE MSAG SET StreetPrefix='$_StreetPrefix',  
                                    StreetName='$_StreetName',  
                                    LOWNUMBER='$_LOWNUMBER',
                                    HighNumber='$_HighNumber',
                                    EOB='$_EOB',
                                    ESN='$_ESN',
                                    COMMUNITY='$_COMMUNITY',
                                    TELCO='$_TELCO',
                                    MAP='$_MAP',
                                    DateEntered='$_DateEntered',
                                    DateModified='$_DateModified'
                          WHERE StreetID='$_StreetID'"

            
     
    sqlsrv_query($_SQL) or die(sqlsrv_error()); 
      
    //header("Location : index.php?id=$_id"); 
      
    $_html ="<tabel><tr>  
           <td width=\"19%\">RECORD HAS BEEN </td> 
           <td width=\"81%\">UPDATED CLICK <a href=\"index.php\">HERE</a></td> 
         </tr></table>"



    else 
    {
    $_StreetID = (int)($_GET['StreetID']);
    $_sql ="SELECT * FROM MSAG WHERE StreetID=$_StreetID";
    $_rs sqlsrv_query($conn$_sql);

    while(
    $rw sqlsrv_fetch_array($conn$rs) or die(print_r(sqlsrv_errors(), true)));
    {
        
    $_StreetID $_rw['StreetID'];
        
    $_StreetPrefix $_rw['StreetPrefix'];
        
    $_StreetName $_rw['StreetName'];
        
    $_LOWNUMBER $_rw['LOWNUMBER'];
        
    $_HighNumber $_rw['HighNumber'];
        
    $_EOB $_rw['EOB'];
        
    $_ESN $_rw['ESN'];
        
    $_COMMUNITY $_rw['COMMUNITY'];
        
    $_TELCO $_rw['TELCO'];
        
    $_MAP $_rw['MAP'];    
        
    $_DateEntered $_rw['DateEntered'];
        
    $_DateModified $_rw['DateModified'];
    }
    $_html=" <center>
    <form action=\"\" method=\"post\" id=\"_form\" name=\"_form\" enctype=\"multipart/form-data\">

    <table> 
    <tr>  
    <td>Directional: <br><input type=\"text\" name=\"_StreetPrefix\"   size= \"8\" value=\"$_StreetPrefix\" /> <br></td>
    <td>Street Name: <br><input type=\"text\" name=\"_StreetName\"   size= \"50\" value=\"$_StreeName\"  /> <br></td>
    <td>Community: <br><input type=\"text\" name=\"_COMMUNITY\"   size= \"50\" value=\"$_COMMUNITY\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Low Range : <br><input type=\"text\" name=\"_LOWNUMBER\" size= \"8\" value=\"$_LOWNUMBER\" /> <br></td>
    <td>High Range: <br><input type=\"text\" name=\"_HighNumber\"   size= \"8\" value=\"$_HighNumber\"  /> <br></td>
    <td>OEB: <br><input type=\"text\" name=\"_EOB\" size= \"8\" value=\"$_EOB\" /> <br></td>
    <td>ESN Number: <br><input type=\"text\" name=\"_ESN\"   size= \"8\" value=\"$_ESN\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Telco : <br><input type=\"text\" name=\"_TELCO\" size= \"8\" value=\"$_TELCO\" /> <br></td>
    <td>Map Number: <br><input type=\"text\" name=\"_MAP\" size= \"8\" value=\"$_MAP\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Entry Date : <br><input type=\"text\" name=\"_DateEntered\" size= \"8\" value=\"$_DateEntered\" /> <br></td>
    <td>Last Modified: <br><input type=\"text\" name=\"_DateModified\"   size= \"8\" value=\"$_DateModified\" /> <br></td>
    </tr></table>
    <br>

    <table>
    <tr>
    <td>
    <input type=\"submit\" align = \"left\" name=\"edit\" value=\"Edit\"/>
    <input type=\"hidden\" name=\"id\" value=\"$_StreetID\"/>
    </td>

    <td>
    <input type=\"submit\" id=\"delete\" name=\"delete\" value=\"Delete\"/>
    <input type=\"hidden\" name=\"id\" value=\"$_StreetID\"/>
    </td>
    </tr>
    </table>
    </center>"



    ?> 
    <center>
    <h1><u>Record Details</u></h1>
    <br>
    <br>
    </center>

    <?php echo $_html?>

  • #11
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    You don't have an $rs variable. You do have an $_rs variable which is likely what you want to use.
    Careful not to use the die within the while loop condition. It will assign until it hits a false condition, in which case the die will trigger even during a proper iteration. So you'll want to make sure it is removed completely.
    Last edited by Fou-Lu; 12-04-2012 at 08:13 PM.

  • #12
    New Coder
    Join Date
    Aug 2012
    Posts
    65
    Thanks
    5
    Thanked 0 Times in 0 Posts
    alright, making good progress now, Im down to only one error:
    Code:
    Warning: sqlsrv_fetch_array() expects parameter 2 to be long, resource given in C:\Inetpub\wwwroot\msag\modify2.php on line 53
    Code:
    PHP Code:
    <?php include 'includes/head/head_main.php'?>

    <div id = "top_content">
    <body>

    <?php include 'includes/header/header_main.php'?>

    <?php
    include 'includes/db/connect.php';

    if(isset(
    $_POST['edit'])) 

        
    $_StreetPrefix $_rw['StreetPrefix'];
        
    $_StreetName $_rw['StreetName'];
        
    $_LOWNUMBER $_rw['LOWNUMBER'];
        
    $_HighNumber $_rw['HighNumber'];
        
    $_EOB $_rw['EOB'];
        
    $_ESN $_rw['ESN'];
        
    $_COMMUNITY $_rw['COMMUNITY'];
        
    $_TELCO $_rw['TELCO'];
        
    $_MAP $_rw['MAP'];    
        
    $_DateEntered $_rw['DateEntered'];
        
    $_DateModified $_rw['DateModified'];
        
    $_StreetID $_rw['StreetID']; 
       
      
    $_SQL "UPDATE MSAG SET StreetPrefix='$_StreetPrefix',  
                                    StreetName='$_StreetName',  
                                    LOWNUMBER='$_LOWNUMBER',
                                    HighNumber='$_HighNumber',
                                    EOB='$_EOB',
                                    ESN='$_ESN',
                                    COMMUNITY='$_COMMUNITY',
                                    TELCO='$_TELCO',
                                    MAP='$_MAP',
                                    DateEntered='$_DateEntered',
                                    DateModified='$_DateModified'
                          WHERE StreetID='$_StreetID'"

            
     
    sqlsrv_query($_SQL) or die(sqlsrv_error()); 
      
    //header("Location : index.php?id=$_id"); 
      
    $_html ="<tabel><tr>  
           <td width=\"19%\">RECORD HAS BEEN </td> 
           <td width=\"81%\">UPDATED CLICK <a href=\"index.php\">HERE</a></td> 
         </tr></table>"



    else 
    {
    $_StreetID = (int)($_GET['StreetID']);
    $_sql ="SELECT * FROM MSAG WHERE StreetID=$_StreetID";
    $_rs sqlsrv_query($conn$_sql);

    while(
    $_rw sqlsrv_fetch_array($conn$_rs));
    {
        
    $_StreetID $_rw['StreetID'];
        
    $_StreetPrefix $_rw['StreetPrefix'];
        
    $_StreetName $_rw['StreetName'];
        
    $_LOWNUMBER $_rw['LOWNUMBER'];
        
    $_HighNumber $_rw['HighNumber'];
        
    $_EOB $_rw['EOB'];
        
    $_ESN $_rw['ESN'];
        
    $_COMMUNITY $_rw['COMMUNITY'];
        
    $_TELCO $_rw['TELCO'];
        
    $_MAP $_rw['MAP'];    
        
    $_DateEntered $_rw['DateEntered'];
        
    $_DateModified $_rw['DateModified'];
    }
    $_html=" <center>
    <form action=\"\" method=\"post\" id=\"_form\" name=\"_form\" enctype=\"multipart/form-data\">

    <table> 
    <tr>  
    <td>Directional: <br><input type=\"text\" name=\"_StreetPrefix\"   size= \"8\" value=\"$_StreetPrefix\" /> <br></td>
    <td>Street Name: <br><input type=\"text\" name=\"_StreetName\"   size= \"50\" value=\"$_StreetName\"  /> <br></td>
    <td>Community: <br><input type=\"text\" name=\"_COMMUNITY\"   size= \"50\" value=\"$_COMMUNITY\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Low Range : <br><input type=\"text\" name=\"_LOWNUMBER\" size= \"8\" value=\"$_LOWNUMBER\" /> <br></td>
    <td>High Range: <br><input type=\"text\" name=\"_HighNumber\"   size= \"8\" value=\"$_HighNumber\"  /> <br></td>
    <td>OEB: <br><input type=\"text\" name=\"_EOB\" size= \"8\" value=\"$_EOB\" /> <br></td>
    <td>ESN Number: <br><input type=\"text\" name=\"_ESN\"   size= \"8\" value=\"$_ESN\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Telco : <br><input type=\"text\" name=\"_TELCO\" size= \"8\" value=\"$_TELCO\" /> <br></td>
    <td>Map Number: <br><input type=\"text\" name=\"_MAP\" size= \"8\" value=\"$_MAP\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Entry Date : <br><input type=\"text\" name=\"_DateEntered\" size= \"8\" value=\"$_DateEntered\" /> <br></td>
    <td>Last Modified: <br><input type=\"text\" name=\"_DateModified\"   size= \"8\" value=\"$_DateModified\" /> <br></td>
    </tr></table>
    <br>

    <table>
    <tr>
    <td>
    <input type=\"submit\" align = \"left\" name=\"edit\" value=\"Edit\"/>
    <input type=\"hidden\" name=\"id\" value=\"$_StreetID\"/>
    </td>

    <td>
    <input type=\"submit\" id=\"delete\" name=\"delete\" value=\"Delete\"/>
    <input type=\"hidden\" name=\"id\" value=\"$_StreetID\"/>
    </td>
    </tr>
    </table>
    </center>"



    ?> 
    <center>
    <h1><u>Record Details</u></h1>
    <br>
    <br>
    </center>

    <?php echo $_html?>

  • #13
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Sorry fetching doesn't require a resource. Its packed as a part of the statement. Just give it the $_rs. The second parameter would indicate what kind of fetch it performs.

  • #14
    New Coder
    Join Date
    Aug 2012
    Posts
    65
    Thanks
    5
    Thanked 0 Times in 0 Posts
    That cleared up all the errors on the screen, however, it is not displaying any of the information at all. On my view all page, I click the details button beside the record, and it should open this page with the records details in it for me to view, modify, or delete. In the URL bar it does show the correct path (msag/modify2.php?StreetID=249) but no information. and if I hit the edit key anyways, it throws that same bunch of unidentified variable errors as before.

    see anything outright that could be causing this problem?

    PHP Code:
    <?php include 'includes/head/head_main.php'?>

    <div id = "top_content">
    <body>

    <?php include 'includes/header/header_main.php'?>

    <?php
    include 'includes/db/connect.php';

    if(isset(
    $_POST['edit'])) 

        
    $_StreetPrefix $_rw['StreetPrefix'];
        
    $_StreetName $_rw['StreetName'];
        
    $_LOWNUMBER $_rw['LOWNUMBER'];
        
    $_HighNumber $_rw['HighNumber'];
        
    $_EOB $_rw['EOB'];
        
    $_ESN $_rw['ESN'];
        
    $_COMMUNITY $_rw['COMMUNITY'];
        
    $_TELCO $_rw['TELCO'];
        
    $_MAP $_rw['MAP'];    
        
    $_DateEntered $_rw['DateEntered'];
        
    $_DateModified $_rw['DateModified'];
        
    $_StreetID $_rw['StreetID']; 
       
      
    $_SQL "UPDATE MSAG SET StreetPrefix='$_StreetPrefix',  
                                    StreetName='$_StreetName',  
                                    LOWNUMBER='$_LOWNUMBER',
                                    HighNumber='$_HighNumber',
                                    EOB='$_EOB',
                                    ESN='$_ESN',
                                    COMMUNITY='$_COMMUNITY',
                                    TELCO='$_TELCO',
                                    MAP='$_MAP',
                                    DateEntered='$_DateEntered',
                                    DateModified='$_DateModified'
                          WHERE StreetID='$_StreetID'"

            
     
    sqlsrv_query($_SQL) or die(sqlsrv_error()); 
      
    //header("Location : index.php?id=$_id"); 
      
    $_html ="<tabel><tr>  
           <td width=\"19%\">RECORD HAS BEEN </td> 
           <td width=\"81%\">UPDATED CLICK <a href=\"index.php\">HERE</a></td> 
         </tr></table>"

    }

    else 
    {
    $_StreetID = (int)($_GET['StreetID']);
    $_sql ="SELECT * FROM MSAG WHERE StreetID=$_StreetID";
    $_rs sqlsrv_query($conn$_sql);

    while(
    $_rw sqlsrv_fetch_array($_rs));
    {
        
    $_StreetID $_rw['StreetID'];
        
    $_StreetPrefix $_rw['StreetPrefix'];
        
    $_StreetName $_rw['StreetName'];
        
    $_LOWNUMBER $_rw['LOWNUMBER'];
        
    $_HighNumber $_rw['HighNumber'];
        
    $_EOB $_rw['EOB'];
        
    $_ESN $_rw['ESN'];
        
    $_COMMUNITY $_rw['COMMUNITY'];
        
    $_TELCO $_rw['TELCO'];
        
    $_MAP $_rw['MAP'];
        
    $_DateEntered $_rw['DateEntered'];
        
    $_DateModified $_rw['DateModified'];
    }
    $_html=" <center>
    <form action=\"\" method=\"post\" id=\"_form\" name=\"_form\" enctype=\"multipart/form-data\">

    <table> 
    <tr>  
    <td>Directional: <br><input type=\"text\" name=\"_StreetPrefix\"   size= \"8\" value=\"$_StreetPrefix\" /> <br></td>
    <td>Street Name: <br><input type=\"text\" name=\"_StreetName\"   size= \"50\" value=\"$_StreetName\"  /> <br></td>
    <td>Community: <br><input type=\"text\" name=\"_COMMUNITY\"   size= \"50\" value=\"$_COMMUNITY\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Low Range : <br><input type=\"text\" name=\"_LOWNUMBER\" size= \"8\" value=\"$_LOWNUMBER\" /> <br></td>
    <td>High Range: <br><input type=\"text\" name=\"_HighNumber\"   size= \"8\" value=\"$_HighNumber\"  /> <br></td>
    <td>OEB: <br><input type=\"text\" name=\"_EOB\" size= \"8\" value=\"$_EOB\" /> <br></td>
    <td>ESN Number: <br><input type=\"text\" name=\"_ESN\"   size= \"8\" value=\"$_ESN\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Telco : <br><input type=\"text\" name=\"_TELCO\" size= \"8\" value=\"$_TELCO\" /> <br></td>
    <td>Map Number: <br><input type=\"text\" name=\"_MAP\" size= \"8\" value=\"$_MAP\"  /> <br></td>
    </tr></table>
    <br>

    <table> 
    <tr>  
    <td>Entry Date : <br><input type=\"text\" name=\"_DateEntered\" size= \"8\" value=\"$_DateEntered\" /> <br></td>
    <td>Last Modified: <br><input type=\"text\" name=\"_DateModified\"   size= \"8\" value=\"$_DateModified\" /> <br></td>
    </tr></table>
    <br>

    <table>
    <tr>
    <td>
    <input type=\"submit\" align = \"left\" name=\"edit\" value=\"Edit\"/>
    <input type=\"hidden\" name=\"id\" value=\"$_StreetID\"/>
    </td>

    <td>
    <input type=\"submit\" id=\"delete\" name=\"delete\" value=\"Delete\"/>
    <input type=\"hidden\" name=\"id\" value=\"$_StreetID\"/>
    </td>
    </tr>
    </table>
    </center>"



    ?> 
    <center>
    <h1><u>Record Details</u></h1>
    <br>
    <br>
    </center>

    <?php echo $_html?>
    Last edited by willscarlet; 12-05-2012 at 02:26 PM.

  • #15
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Remove the semi-colon from the end of the while loop.
    Although if you are only expecting one record (as this indicates), then don't loop it at all.


  •  
    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
    •