Jump to content

xtops

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Posts posted by xtops

  1. i already try your suggestion but still with this error

     

    Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /var/www/IpSearch.php on line

     

    and this error when i click submit button

     

    Warning: Procedure IpPhoneDir.GetBranchBeg can't return a result set in the given context

     

     

  2.  

    this is the error

     

     

    Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /var/www/IpSearch.php on line

     

     

    <?php
    
    $srch = $_REQUEST["srch"];
    
    if (empty($srch)) {
        print <<<HERE
        <form>
        Type the Store location:
        <input type = "text"
               name = "srch">
        <input type = "submit">
        </form>
    HERE;
        
    } else {
    
            $con = mysql_connect("localhost","root","icebird");
    
            if (!$con) {
                die('Could not connect: ' . mysql_error());
            }
            
            mysql_select_db("IpPhoneDir", $con);
    
            // Send a query to the server 
            if ($result = mysql_query($con, "call GetBranchBeg($srch)")) {
        
                $um_rows = mysql_num_rows($result);
                if($num_rows <= 0) {
                    echo "no match found";
                }    
                print "<table border = 1>\n";
                 
                    //get row data as an associative array
                    While ($row = mysql_fetch_assoc($result)) {
                        print "<tr>\n";
                        //look at each field
                        foreach ($row as $col=>$val){
                        print "<td>$val</td>\n";
                        }//end foreach
                        print "</tr>\n\n";
                    }//end while-
                print "</table>\n";
    
            } else {
                trigger_error(mysql_error(),E_USER_WARNING);  //this will display MySQL's error message
            } 
    }
    mysql_close($con)
    
    
    ?> 
    

     

     

     

    DROP PROCEDURE `GetBranchBeg`//
    CREATE DEFINER=`root`@`localhost` PROCEDURE `GetBranchBeg`(IN starts_with CHAR(15))
    BEGIN
        DECLARE tmp CHAR(15); 
        SET tmp = CONCAT(starts_with, '%'); 
        SELECT IpPhoneNo, location FROM IpPhoneList WHERE location LIKE tmp OR location =starts_with;
    END
    
    
    

  3.  

     

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/IpSearch.php on line 18

     

    <?php
    
    $con = mysql_connect("localhost","root","icebird");
    
    if (!$con) {
      die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("IpPhoneDir", $con);
    
    /* Send a query to the server */
    if ($result = mysql_query($con, "call GetBranchBeg('gsc')")) {
        print "<table border = 1>\n";
                 
        //get row data as an associative array
       While ($row = mysql_fetch_assoc($result))
              { print "<tr>\n";
             //look at each field
               foreach ($row as $col=>$val){
                print "<td>$val</td>\n";
                                
               }//end foreach
        print "</tr>\n\n";
        
       }//end while-
       print "</table>\n";
    
    }//end if
    
    /* Close the connection */
    mysql_close($con)
    ?> 
    
    
    

     

    this is the content of my stored procedure

     

    DROP PROCEDURE `GetBranchBeg`//
    CREATE DEFINER=`root`@`localhost` PROCEDURE `GetBranchBeg`(IN starts_with CHAR(15))
    BEGIN
        DECLARE tmp CHAR(15); 
        SET tmp = CONCAT(starts_with, '%'); 
        SELECT IpPhoneNo, location FROM IpPhoneList WHERE location LIKE tmp OR location =starts_with;
    END
    
    
    

     

     

     

  4. ERROR 1064 (42000): 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 ';))

     

     

    DELIMITER //
    CREATE PROCEDURE ValidateData(IN in_IpPhno VARCHAR(30),  in_loc VARCHAR(30),    OUT out_status INT) 
    MODIFIES SQL DATA
    BEGIN     
               IF (!EXISTS(SELECT IpPhone, location  FROM IpPhoneList  
                                 WHERE IpPhoneNo = in_IpPhno OR location = in_loc;)) THEN     
                      set out_status = '1';
                      INSERT INTO IpPhonelist (IpPhoneNo, location)
                               VALUES (in_IpPhno, in_loc);
                ELSE  
                      set out_status = '0';
                END IF;
    END//
    
    
    
    
    
    
    
    
    
    
    

  5. Parse error: syntax error, unexpected $end in /var/www/borderMaker.php on line 3

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    <html lang="en">
    <head>
        <title>Your Output</title>
    </head>
    <body>
        <h1>Your output</h1>
        <center>
            <?php
            
            //$borderSize = $_REQUEST["borderSize"];
            //$sizeType = $_REQUEST["sizeType"];
            //$borderStyle = $_REQUEST["borderStyle"];
        
            
            $theStyle = <<<HERE
            "border-width:$borderSize $sizeType;
            border-style: $borderStyle;
            border-color: green"
            HERE;
            
            print "<div style = $theStyle>";
            print $basicText;
            print "</span>";            
            ?>
        </center>
        
    </body>
    </html>
    
    
    

  6. gud day!!guro whats wrong with my program..my function readfile wont work..theres no error found and no display on tips.txt..they are on the same directory..

     

     

     

    <html>
    <head>
    <title>Tip of the day</title>
    </head>
    
    <body>
    <center>
    
    <h1>Tip of the day</h1>
    
    <div style = "border-color:green; border-style:groove; border-width:2px">
    <?
    readfile("tips.txt");
    ?>
    </div>
    
    </center>
    </body>
    </html
    
    

  7. why is that i cant view the ouput of the readfile function they are in same location.

    no error found...is the some missing of my code

     

     

     

    <html>
    <head>
    <title>Tip of the day</title>
    </head>
    
    <body>
    <center>
    
    <h1>Tip of the day</h1>
    
    <div style = "border-color:green; border-style:groove; border-width:2px">
    <?
    readfile("tips.txt");
    ?>
    </div>
    
    </center>
    </body>
    </html>
    
    

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.